Create User Profile and Organizational Profile SubTypes in PowerShell

I am building a script for one of my demos and just created the User Profile SubTypes and Organizational Profile SubTypes with PowerShell like this:

#Get the Server Context
$context = Get-SPServiceContext -Site http://me
#Add User Profile Sub-Types 
#Get the Profile Subtype Manager
$psm = [Microsoft.Office.Server.UserProfiles.ProfileSubtypeManager]::Get($context);
#create a user profile subtype
$psm.CreateSubtype("SearchTeam","Search Team", [Microsoft.Office.Server.UserProfiles.ProfileType]::User);
$psm.CreateSubtype("AccountExecutive", "Account Executive", [Microsoft.Office.Server.UserProfiles.ProfileType]::User);
#create an organization profile subtype
$psm.CreateSubtype("Official", "Official Organization", [Microsoft.Office.Server.UserProfiles.ProfileType]::Organization);
$psm.CreateSubtype("Fun", "Fun Organization", [Microsoft.Office.Server.UserProfiles.ProfileType]::Organization);
$psm.CreateSubtype("Professional", "Professional Organization", [Microsoft.Office.Server.UserProfiles.ProfileType]::Organization);
|| Building Blocks || My Sites || Office 2010 || SharePoint 2010 || Social Computing || Tools

comments powered by Disqus

Let's Get In Touch!

Ready to start your next project with us? That’s great! Give us a call or send us an email and we will get back to you as soon as possible!