hi
use WINRM , and create a session to my AD server like this :
$ADsession = New-PSSession -computerName dc01
Invoke-command { import-module activedirectory } -session $ADsession
import-pssession $ADsession -CommandName New-ADUser -AllowClobber
When I run : New-ADUser existuser -ErrorVariable ADError
I can't get the value of $ADError on my PC console