Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Powershell Rights - New-ADUser?

$
0
0

I'm doing a PS Script for making new users, as I consistently forget things that I'm supposed to do...hah. The script is more complex than this, but this is the part I'm having issues with...

$first = Read-Host 'What is the first name?'
$last = Read-Host 'What is the last name?'
$fullName = "$first $last"
$name = Read-Host 'What is the username?'
$pass = "Password!"
$PassSec = ConvertTo-SecureString $($pass) -AsPlainText -Force

New-ADUser -Name $fullName -AccountPassword $PassSec -ChangePasswordAtLogon $true

Everything works fine, up until the last bit. When it executes that, I get an Access is Denied message. I'm a member of Enterprise Admins, Domain Admins, Account Operators, and Domain Users...do you guys know what might be blocking me?

I've tried using the script while running Powershell as an administrator, I get the same message.

Thanks!


Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>