This is how to install PowerShell 2.0 and WMI for Windows XP via batch file which minimizes the installation process replication.
1. Create a server share that all your computers can access (i.e. \\server\share$)
2. Download the full DotNet Framework 3.5 Service Pack 1 (dotnetfx35.exe)and place the file into the \\server\share$ location.
2. Download PS 2.0 for XP (WindowsXP-KB968930-x86-ENG.exe) and place the file into the \\server\share$ location.
3. You will create two new scripts in your \\server\share$ folder. One will be the installation batch file and the other will be a WMI remote-enabling PowerShell script.
- if not exist "%SystemRoot%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5 SP1\*.*" \\server\share$\dotnetfx35.exe (you will have to interact with this executable should it need to install)
- if not exist "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" \\server\share$\WindowsXP-KB968930-x86-ENG.exe /q (no interaction needed)
- regedit /i /s \\server\share$\unrestrictedps.reg (create a .reg file with:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"Path"="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
"ExecutionPolicy"="Unrestricted"
4. "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" \\server\share$\XP-enableremote.ps1
Then the PowerShell script:
- enable-psremoting -force
- set-item wsman:localhost\client\trustedhosts -value * -force
No comments:
Post a Comment