Imanami Community

Join or create discussions about common issues and solutions.
Welcome to Imanami Community Sign in | Join | Help
in Search

Creating new users

Last post 02-12-2008, 9:37 PM by Robert Haaverson. 2 replies.
Sort Posts: Previous Next
  •  02-08-2008, 9:20 AM 476

    Creating new users

    Hi All,

     I am working on creating a Job in DTM to create new users.  The Source is Oracle, destination is AD.  Is there a way to query if a SAM account name already exist in AD and if so to use letters of the first name.

    Our company usernames are last name first initial.  For example if we have an existing user John Smith (username:"smithj") and creating via DTM Joe Smith, we would like DTM for Alias and SAM account to create "smithjo"

  •  02-12-2008, 9:37 PM 482 in reply to 476

    Re: Creating new users

    The AD PowerTool (available from support) can check for uniqueness.  Here is a sample script that goes int he Add-Rowing event of the GlobalScript Editor...

     

    sub DTM_RowAdding(dtmsource As Object, args As JobEventArgs) handles DTM.RowAdding

    ' User-definable script goes here -----------------

    Dim firstName as string = DTM.Source("fname")

    Dim middleInitial as string = DTM.Source("initial")

    Dim lastName as string = DTM.Source("lname")

    Dim index As Integer = 1

    Dim unique As Boolean = True

    Dim position As Integer

    ActiveDirectoryTool.ConfigureFromDestination()

    'Begin constructing an alias by concatenating the first letter of the firstname with lastname

    Dim uniqueAlias As String = firstName.Substring(0, 1) & lastName

    ' Check if the constructed alias is unique

    if(Not ActiveDirectoryTool.VerifyUniqueInDomain("mailNickname=" & uniqueAlias)) then

    ' If not unique, then construct an alias by concatenating the first name, a period and the lastname

    uniqueAlias = firstName + "." + lastName

    ' Check if the constructed alias is unique

    if(Not ActiveDirectoryTool.VerifyUniqueInDomain("mailNickname=" & uniqueAlias)) then

    ' If the alias is not unique, then construct an alias by concatenating the first name, a period, middle initial, a period and the last name

    uniqueAlias = firstName + "." + middleInitial + "." + lastName

    ' Check if the constructed alias is unique

    if(Not ActiveDirectoryTool.VerifyUniqueInDomain("mailNickname=" & uniqueAlias)) then

    ' Can't construct an unique alias. So, throw an exception or send an e-mail to the administrator

    NotificationTool.SimpleSendHtmlNotification("raja.mani@imanami.com", _

    System.String.Format("RowAdding: Cannot construct an unique alias with {0} {1} {2}", firstName, middleInitial, lastName), _

    System.String.Format("RowAdding: Cannot construct an unique alias with {0} {1} {2}", firstName, middleInitial, lastName))

    end if

    end if

    end if

    if(ActiveDirectoryTool.VerifyUniqueInDomain("mailNickname=" & uniqueAlias)) then

    ' The alias is unique

    args.StagingDestination("mailNickname") = uniqueAlias

    end if

  •  02-12-2008, 9:37 PM 483 in reply to 482

    Re: Creating new users

    Note: Each red & should be &
View as RSS news feed in XML
Powered by Community Server (Personal Edition), by Telligent Systems