Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Issue with remote Rename-Computer script

$
0
0

I have created a script to bulk rename PCs based off of a .csv with OldName,NewName.

For some reason however, on our domain I get access denied with the basic Rename-computer command (running Powershell with full admin rights) I have assigned $Creds = Get-Credentials

Powershell
Rename-Computer-NewNameNewname-ComputernameOldname-DomainCredential$Creds

It does work if I initiate a Enter-PSSession in a PowerShell Window then run the command

Powershell
Enter-PSSessionOldnameRename-Computer-newNameNewname-DomainCredential$Creds

I would like to figure out how to incorporate Enter-PSSession, NewPSSession, or whatever the correct remoting process would be to get this to work.

When I have tried either of the above, it ends up trying to rename the computer I am running from instead of the remote one, so I am sure that I either...


Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>