I am working on a project that preps some servers for MS Lync installation. I have created a VB.Net program that will generate a PS1 file based on the role a specific server will play. I need the contents of that file to execute on a remote server. The beginning of that PS1 file has the following:
The problem I am having is that the Add-WindowsFeature commands are executing locally rather than on the computer targeted int he remote session. Can anyone point me to what I am doing wrong?
I hope that helps.
Regards,
Mark
Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
Code:
Enter-PSSession SERVERNAME -Credential domain\username
Import-Module ServerManager -verbose
Add-WindowsFeature AS-NET-Framework -verbose
Add-WindowsFeature NET-Framework-Core -verbose
Add-WindowsFeature MSMQ-Server -verbose
Add-WindowsFeature MSMQ-Directory -verbose
Add-WindowsFeature PowerShell-ISE -verbose
Add-WindowsFeature Telnet-Client -verbose
Add-WindowsFeature FS-FileServer -verbose
Add-WindowsFeature SNMP-Service -verbose
Add-WindowsFeature SNMP-WMI-Provider -verbose
Add-WindowsFeature WAS-Process-Model -verbose
Add-WindowsFeature WAS-NET-Environment -verbose
Add-WindowsFeature WAS-Config-APIs -verbose
Exit-PSSession
The problem I am having is that the Add-WindowsFeature commands are executing locally rather than on the computer targeted int he remote session. Can anyone point me to what I am doing wrong?
I hope that helps.
Regards,
Mark
Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.