Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Gui development

$
0
0

sorry Mr. Jones I have create in the Gui four textboxes, (testing with only two) $Nametextbox1 and $SamAccounttextbox2. I also created a submit button. I fill in the name and Samsaccount and press the submit button.

buttonSubmit_Click={
#TODO: Place custom script here

invoke-command -cn labdc4 -ScriptBlock {new-aduser -name $Nametextbox1 -SamAccountname $SamAccounttextbox2 `
-path ‘cn=users, dc=cosdepot,dc=local’ -enabled $true -accountpassword (convertto-secureString -asplaintext “ZAQ!2wsx” -force)}
error code returned is Cannot validate argument on parameter ‘Name’. The argument is null or empty. Supply an argument that is not null or empty and then try the command again. Thanks you for your assistance.

}


Viewing all articles
Browse latest Browse all 13067

Trending Articles