Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ErrorActionPreference = "Stop"
- $SecureString = ConvertTo-SecureString -String "\`d.T.~Vb/{41BAA34C-B0E6-41D0-8F2B-CB3901AAF6A8}\`d.T.~Vb/" -AsPlainText -Force
- $Creds = New-Object system.Management.Automation.PSCredential("domain\os2uag_connector", $SecureString)
- $SessionOpt = New-PSSessionOption -OperationTimeout (30*60*1000)
- $Session = New-PSSession -ComputerName "server-uag01" -Credential $Creds -SessionOption $SessionOpt
- Invoke-Command -Session $Session -ScriptBlock {Import-Module "c:\Scripts\UAGFunctions.ps1"}
- Invoke-Command -Session $Session -ScriptBlock {Set-UAGConfig -BackupDir "c:\EGFBackups" -UAGActivatorPath "c:\Scripts\UAGActivate.exe" }
- Invoke-Command -Session $Session -ScriptBlock { Activate-UAGConfig }
- $Session | Remove-PSSession
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement