Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $username = 'UsernameHere';
- $password = 'PasswordHere';
- $securePassword = ConvertTo-SecureString $password -AsPlainText -Force;
- $credential = New-Object System.Management.Automation.PSCredential $username, $securePassword
- Invoke-Command -ComputerName localhost -Credential $credential -ScriptBlock { commands go here }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement