PowerShell implicit remoting on imported a cmdlet

Tags: PowerShell, AD, Implicit, Remoting

Import-PSSession -Session (
	New-PSSession -ComputerName dc01 -Credential (Get-Credential)
) -CommandName New-ADUser
 
$Password = Read-Host -assecurestring "SP2013 Farm Account Password"
$Name = "spExtranetFarm"
$UPN = "spExtranetFarm@mikefrobbins.com"
$Description = "SharePoint Farm Administrator Account - Extranet"
$Path = "ou=service,ou=accounts,ou=test,dc=mikefrobbins,dc=com"
New-ADUser -Name $Name -AccountPassword $Password -Description $Description `
	-Enabled $true `
-PasswordNeverExpires $true `
-Path $Path `
-SamAccountName $Name ` -UserPrincipalName $UPN