Do you have SharePoint installed on a development or test environment somewhere? Does it have it’s own Active Directory installation? So, how do you explore all the wonderful features of the SharePoint User Profile service? You know, like the Silverlight organisation chart, or Audiences, or Colleagues, or…
Well, not to fear, after much procrastination, I’m finally able to provide a solution to your problem. I’ve made up names, job titles and managers for 100 people. Any similarity to real people is purely coincidental. Not only that, but I’ve created a PowerShell script to create these accounts in Active Directory.
This means your User Profiles in your virtual environment can go from a bland handful of test accounts, to a dazzling collection of fictitious employees in different departments, physical offices and job titles. Just imagine the Audiences you can create!
Feel free to edit the CSV file (using Excel) to modify personal details and add more people. You can even add additional user properties, but you will also need to make some changes to the PowerShell script to get these into Active Directory, not hard if you are familiar with PowerShell.
I’ve tested the PowerShell script on a Windows 2008 R2 domain, however I executed it from a Windows 7 desktop. The script does not require Microsoft Exchange or third party script add-ons. I execute the script using the domain admin account. You may run into issues if you try using accounts with less privileges.
The script contains a path to an Active Directory Organisation Unit (OU) where all the accounts will be created (OU=Staff,DC=lab,DC=laptop,DC=iw). You will want to change this before running it in your environment. This OU needs to exist before you run the script.
I have configured the script to create the accounts but not to enable them. This is for security purposes. However, if you want to enable them, you just need to uncomment two lines and seek legal advice.
You can download the zip file containing the people details and PowerShell script from here. Any feedback greatly appreciated.
11 comments:
Very useful - thanks Ivan. It will be used in all my future demo/dev environments :-)
Great stuff. I was looking for something like this on Friday!
Thanks Ivan. In the process of creating a demo environment so has come at the right time
Ivan
It might just be me, but I needed to amend the script and put the function (ProvisionInputCSV) call at the end.
Otherwise the script isn't aware of the declared functions. Worked a treat once it was changed.
Thanks again, this is very useful.
Thanks for the feedback Tim. I've updated the script to fix this
Hi,
very useful. It seems, however, that the download link is broken.
br,
Patrick
Hi Patrick - sorry to hear that you are having problems with the download. I just tested it myself and it worked. Would you be able test again?
Thnaks one of my client having some problem your blog is giving some useful idea thanks
getting errors... :(
my test domain is ... 123.corp
altered the script but getting: You cannot call a method on a null-valued expression...
very usefull
Hi there. Nice blog. You have shared useful information. Keep up the good work! This blog is really interesting and gives good details. web development Delhi, web development in Delhi.
Post a Comment