Some years ago I needed to rollout SSO for SAP GUI windows client. At that time I used AD GPO preferences to deploy the required DLL's, INI + services file and the system environment settings. The solution has worked for many years succesfully, now and than IT support forgot to add the computer acocunt to the AD group before the configuration was applied to the systems due to targeting of the settings.
At some point Windows 8 and now Windows 10 64bit architectures was introduced and SAP SSO stopped working after the new client was staged. GPO was assigned to this computer but the system folder has changed. From C:\Windows\system32 you now need to copy the DLL files to C:\Windows\SysWOW64. With finalizing the Windows 10 task sequence for Operating System deployment I wanted to have this whole process of applying the SSO configuration for SAP GUI from a PowerShell script.
My objective is to have the script working with Windows 7 – 32 bit and also with Windows 10 – 64 bit. The script should include all configuration so AD GPO was not needed anymore when the installation of a client was completed.
SAP-SSO-Configuration.ps1
- I used the script below for configuring SAP GUI SSO on Windows
- Created new SCCM package where I stoped all required files that should be copied
- Integrated new PowerShell command from SCCM Task Sequence and run the SAP-SSO-Configuration.ps1 script
#FileName: SAP-SSO-Configuration.ps1 #Author: Ivan Versluis #Creation date: 11-AUG-2016 #Description: This PowerShell script is checking hardware architecture and based on that copies SAP SSO DLL files, #SAPlogon.ini configuration, services file and the system environment variables needed. During the SCCM OSD installation #all required files are installed for SAP GUI. #Version Control #1.1 initial version and integration with SCCM OSD-TS. SAPlogon.ini from 28.07.16 $architecure = $ENV:PROCESSOR_ARCHITECTURE If ($architecure -eq "amd64") { write-host "Configuring 64bit SAP SSO configuration" Copy-Item -Path "$PSScriptRoot\gsskrb5.dll" -Destination "C:\Windows\SysWOW64" -force Copy-Item -Path "$PSScriptRoot\gssntlm.dll" -Destination "C:\Windows\SysWOW64" -force Copy-Item -Path "$PSScriptRoot\gx64krb5.dll" -Destination "C:\Windows\SysWOW64" -force Copy-Item -Path "$PSScriptRoot\gx64ntlm.dll" -Destination "C:\Windows\SysWOW64" -force Copy-Item -Path "$PSScriptRoot\sncgss32.dll" -Destination "C:\Windows\SysWOW64" -force Copy-Item -Path "$PSScriptRoot\sncgss64.dll" -Destination "C:\Windows\SysWOW64" -force If ((Test-Path "C:\SAP") -eq 0) { New-Item -Path "C:\SAP" -ItemType Directory } Copy-Item -Path "$PSScriptRoot\saplogon.ini" -Destination "C:\SAP" -force Copy-Item -Path "$PSScriptRoot\services" -Destination "C:\Windows\System32\drivers\etc" -force [Environment]::SetEnvironmentVariable("SAPLOGON_INI_FILE", "C:\SAP\saplogon.ini", "Machine") [Environment]::SetEnvironmentVariable("SNC_LIB", "gsskrb5.dll", "Machine") write-host "Finished 64bit SAP SSO configuration" } Else { write-host "Configuring 32bit SAP SSO configuration" Copy-Item -Path "$PSScriptRoot\gsskrb5.dll" -Destination "C:\Windows\System32" -force Copy-Item -Path "$PSScriptRoot\gssntlm.dll" -Destination "C:\Windows\System32" -force Copy-Item -Path "$PSScriptRoot\gx64krb5.dll" -Destination "C:\Windows\System32" -force Copy-Item -Path "$PSScriptRoot\gx64ntlm.dll" -Destination "C:\Windows\System32" -force Copy-Item -Path "$PSScriptRoot\sncgss32.dll" -Destination "C:\Windows\System32" -force Copy-Item -Path "$PSScriptRoot\sncgss64.dll" -Destination "C:\Windows\System32" -force If ((Test-Path "C:\SAP") -eq 0) { New-Item -Path "C:\SAP" -ItemType Directory } Copy-Item -Path "$PSScriptRoot\saplogon.ini" -Destination "C:\SAP" -force Copy-Item -Path "$PSScriptRoot\services" -Destination "C:\Windows\System32\drivers\etc" -force [Environment]::SetEnvironmentVariable("SAPLOGON_INI_FILE", "C:\SAP\saplogon.ini", "Machine") [Environment]::SetEnvironmentVariable("SNC_LIB", "gsskrb5.dll", "Machine") write-host "Finished 32bit SAP SSO configuration" }
Leave a comment