Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $password = <password text> | ConvertTo-SecureString -asPlainText -Force
- $username = "admin"
- $credential = New-Object System.Management.Automation.PSCredential($username,$password)
- net use Z: \$ipAddressC$ <password> /user:admin type 'z:Program FileslalalandDataSettings.xml'
- (Get-Content 'z:Program FileslalalandDataSettings.xml') | ForEach-Object { $_ -replace $oldString, $newString } | Set-Content 'z:Program FileslalalandDataSettings.xml'
- type 'z:Program FileslalalandDataSettings.xml'
- net use z: /delete
- .Replace-StringInFile.ps1 -ComputerName <RemoteComputerHostName> -TargetPath 'C:Program Files (x86)lalalandData' -Fil
- New-PSSession : [<RemoteHostName>] Connecting to remote server <RemoteHostName> failed with the following error message : The user name or password is incorrect. For more information, see the
- about_Remote_Troubleshooting Help topic.
- At D:workspaceReplace-StringInFile.ps1:84 char:14
- + ... $Session = New-PSSession -ComputerName $Computer -Credential $Creden ...
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
- + FullyQualifiedErrorId : LogonFailure,PSSessionOpenFailed
Add Comment
Please, Sign In to add comment