Hmmmm. I get just under a second. How does your loop differ?

function newSecurePassword( [string]$password )
{
                $secure = new-object System.Security.SecureString

                $password.ToCharArray() |% { $secure.AppendChar($_) }

                return $secure
}


for( $count = 1; $count -le 10; $count++ )
{
  Measure-Command {
    New-AdUser `
                -Name $('User' + $count.ToString()) `
                -DisplayName $('User' + $count.ToString()) `
                -GivenName $('User' + $count.ToString()) `
                -Surname Smith `
                -AccountPassword $( newSecurePassword P@`$`$w0rd1 ) `
                -Department IT `
                -EmailAddress $('User' + $count.ToString() + '@example.com') `
                -UserPrincipalName $('User' + $count.ToString() + 
'@example.com') `
                -Path 'ou=testou,dc=example,dc=com' `
                -Enabled $true
  }
}

Regards,

Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com

From: Joseph L. Casale [mailto:[email protected]]
Sent: Thursday, October 06, 2011 3:34 PM
To: NT System Admin Issues
Subject: RE: Powershell New-ADUser scalability issue

Added a -server and here is the measure output:
Creating User: <...>
Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 10
Milliseconds      : 205
Ticks             : 102059847
TotalDays         : 0.000118124822916667
TotalHours        : 0.00283499575
TotalMinutes      : 0.170099745
TotalSeconds      : 10.2059847
TotalMilliseconds : 10205.9847

Its fairly constant, and bad:)

Thanks Michael!
jlc

________________________________
From: Michael B. Smith [[email protected]]
Sent: Thursday, October 06, 2011 1:27 PM
To: NT System Admin Issues
Subject: RE: Powershell New-ADUser scalability issue
Add -Server to specify a local domain controller, and then actually check it 
out with Measure-Command. Let us know what the real speed is.

Regards,

Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com

From: Joseph L. Casale 
[mailto:[email protected]]<mailto:[mailto:[email protected]]>
Sent: Thursday, October 06, 2011 3:23 PM
To: NT System Admin Issues
Subject: Powershell New-ADUser scalability issue

I'm using New-ADUser with:
-Name
-DisplayName
-GivenName
-Surname
-AccountPassword
-Department
-EmailAddress
-UserPrincipalName
-Path
-Enabled

the user creation is to slow. I presume it has something to do with the wack of 
additional attr's it must process and check.

Any way around this? Better method to use?

Thanks guys,
jlc

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
[email protected]<mailto:[email protected]>
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
[email protected]<mailto:[email protected]>
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
[email protected]<mailto:[email protected]>
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

Reply via email to