[There's a reason that Yoda is the unofficial mascot of SBS.  Size indeed matters not.] Essentials migration steps - adding a user the script way - THE OFFICIAL BLOG OF THE SBS DIVA
Mon, Mar 28 2011 23:38 bradley

Essentials migration steps - adding a user the script way

Since I've been blogging on migrating from SBS 2003 to SBS essentials a new version of the document came out.

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=288a1d8a-5620-4f20-ad67-20af97275a80&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3a+MicrosoftDownloadCenter+$Microsoft+Download+Center$

This one includes a script to add users to the console

To use a script to import users into the Dashboard

1.   On the Destination Server, open Notepad and copy the following text into it:

"Script to Import Active Directory Users to the SBS 2011 Essentials Dashboard"

import-module -name activedirectory

$users = get-aduser -filter *

foreach ($user in $users)

{

 If ($user.enabled -eq $True)

  {

$imported = Select-String -path "C:\ProgramData\Microsoft\Windows Server\Data \settingsproviderdata\IDENTITY\USERS\index.xml" -pattern $user.samaccountname

 

If ([boolean]$imported -eq $False)

{

$import = read-host "Do you want to import" $user.name "to the Dashboard [y]/[n]"

 

If ($import -eq "y")

        {

write-host {Importing User} $user.name

import-wssuser -name $user.samaccountname | out-null

If( (get-wssuser -name $user.samaccountname).UserStatus -eq "Enabled")

    {

write-host User Successfully Imported

          }

        }

      }

   }

}

 

2.   Save the file on the Destination Server in any folder with a name you choose (for example, C:\importusers.ps).

3.   Open a Command Prompt window as an administrator. For more information, see To open a Command Prompt window as an Administrator.

4.   Change directory to c:\program files\windows server\bin.

5.   Type wsspowershell.exe, and then press ENTER.

6.   Type <path><filename> for the script file you created (for example, C:\importusers.ps), and then press ENTER.

Filed under: