Andrey Bushman
Andrey Bushman

Reputation: 12516

Applying the `Enable-PSRemoting` cmdlet for set computers

PowerShell 4.0, Windows domain

From get-help Enable-PSRemoting:

You need to run this command only once on each computer that will receive commands.

Ok, but our company has more than 500 computers... The connecting to each computer and launching on it this cmdlet will take a lot of time. Is exist the simple way of solving of this problem?

Upvotes: 0

Views: 194

Answers (1)

Andrey Bushman
Andrey Bushman

Reputation: 12516

I've done it through the PsExec.exe by Mark Russinovich. I can get computer names from Active Directory and then launch for each of them (through the cicle) this:

psexec \\computerName powershell -Command "Enable-PSRemoting -Force"

and (if this is necessary)

psexec \\computerName powershell -Command "Disable-PSRemoting -Force"

The psexe can be launched with -d option if it are to be launched in the batch processing on the many computers.

Upvotes: 1

Related Questions