'How do I connect the commands

So, this is my first script ever and I'm not an programmer. Infact, im an 15 year old student, so dont expect much from me, but I need to write a script to create a new User in an AD. And I just cant connect these two command. I want to connect the SamAccountName and the UserPrincipalName into one popup.this is my "code" Btw. im using PowerShell, if this gives u any information



Solution 1:[1]

Use the New-ADUser cmdlet from the ActiveDirectory module.

So if you're looking to create this using SamAccountName and UserPrincipalName it would look something like:

New-ADUser -SamAccountName $SANInput -UserPrincipalName $UPNInput

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 69jimjim