I have been trying to use the below code and it doesn’t seem to work , I get error stating “The RPC server is unavailable”
computer.csv contains 2 columns “OLDNAME” & " NEWNAME"
I’m trying to rename multiple computers however before the rename happens I want ipconfig and services info collected and saved in a text or html format.
Import-Csv -Path C:\Users\Wicky\Desktop\COMPUTERS.csv| ForEach-Object { Get-WMIObject Win32_Service -ComputerName $.OLDNAME ; Get-WMIObject Win32_process -ComputerName $.OLDNAME ;
Invoke-Command -ComputerName $.OLDNAME {systeminfo} ;Get-ADOrganizationalUnit -ComputerName $.OLDNAME ;
| Rename-Computer -DomainCredential $cred -ComputerName $.OLDNAME -NewName $.NEWNAME}|
Out-File rename.txt
could you please help editing my script to work.TIA