Reputation: 135
i want to enable powershell remoting on other computer remotely . And remote computer require authentication. I tried to create a batch file which schedules a task executing Enable-Psremoting , apparently i was unable to put it in remote computer.
Upvotes: 2
Views: 7756
Reputation: 28144
If you're in a domain, you can create a GPO to enable remoting. See http://www.briantist.com/how-to/powershell-remoting-group-policy/
You can also use psexec
to remotely execute PowerShell (see "whatyousay"'s answer at the bottom), passing in enable-psremoting
as a script to execute.
psexec \\[computer name] -u [admin account name] -p [admin account password] -h -d powershell.exe "enable-psremoting -force"
If you're doing it for a large number of systems, GPO is probably best - although you could wrap a PowerShell script around the psexec
version to loop through a list of computers.
Upvotes: 7