Guest User

Untitled

a guest
Nov 19th, 2018
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. $password = <password text> | ConvertTo-SecureString -asPlainText -Force
  2. $username = "admin"
  3. $credential = New-Object System.Management.Automation.PSCredential($username,$password)
  4. net use Z: \$ipAddressC$ <password> /user:admin type 'z:Program FileslalalandDataSettings.xml'
  5.  
  6. (Get-Content 'z:Program FileslalalandDataSettings.xml') | ForEach-Object { $_ -replace $oldString, $newString } | Set-Content 'z:Program FileslalalandDataSettings.xml'
  7. type 'z:Program FileslalalandDataSettings.xml'
  8. net use z: /delete
  9.  
  10. .Replace-StringInFile.ps1 -ComputerName <RemoteComputerHostName> -TargetPath 'C:Program Files (x86)lalalandData' -Fil
  11.  
  12. 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
  13. about_Remote_Troubleshooting Help topic.
  14. At D:workspaceReplace-StringInFile.ps1:84 char:14
  15. + ... $Session = New-PSSession -ComputerName $Computer -Credential $Creden ...
  16. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  17. + CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
  18. + FullyQualifiedErrorId : LogonFailure,PSSessionOpenFailed
Add Comment
Please, Sign In to add comment