Establish a Remote Session to the AdminStudio Machine
Edition:Powershell cmdlets are enabled with AdminStudio Enterprise Edition and with Workflow Manager.
To establish a remote session with a machine that has AdminStudio installed, perform the following configuration steps as mentioned below. These instructions need to be performed on both the AdminStudio-installed machine and the machine initiating the remote session.
To establish a remote session:
1. | Enable PS remoting in both machines (AdminStudio-installed machine and the machine initiating the remote session) by running following cmd: |
Enable-PSRemoting -Force
2. | Machines should be added to trusted list of VM's to establish connection between remote VM and AdminStudio Installed VM. |
Set-Item wsman:\localhost\client\trustedhosts * (Provide IP address of the VM)
Example: Set-Item wsman:\localhost\client\trustedhosts "00.00.000.000"
3. | Restart the WinRM service. |
Restart-Service WinRM
4. | After setting up the Win RM connections, User need to establish remote connection to the AdminStudio VM to run the cmdlets. |
Note:While establishing remote connection we need to add the -ConfigurationName Microsoft.PowerShell32, as AdminStudio dll's are 32-bit configurations.
Sample:
Function Create_RemotePSSession($HostName,$UserName,$Password)
{
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
$Session=New-PSSession -ComputerName $HostName -Credential $cred -ConfigurationName Microsoft.PowerShell32
$session
}