Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by DougInCanada

  1. DougInCanada

    regular expression conversion

    I'm a VB.NET newbie but have worked with VB5 & 6 moons ago, and I'm finally giving in to .NET from vbscripting... The following vbs code was in a script used to create users. It takes into account any hyphens, apostrophes in either the first or last names, as well as corrects for Mc and Mac...
  2. DougInCanada

    Query for pre-existing sAMAccountName

    When I try to add a duplicate name, the script kicks out this error: Error: The object already exists Code: 80071392 Source: (null) The error is generated when I try to perform the objUser.SetInfo and the sAMAccountName already exists. Is there any way to perform error handling using this...
  3. DougInCanada

    Query for pre-existing sAMAccountName

    I have a script for creating a new user object, but I need to be able to check for any pre-existing sAMAccountName in my Active Directory. Id ther a simple way to query my entire AD domain to check for any existing occurrences or do I have to query each possible specific OU? Cheers?
  4. DougInCanada

    Hyphenated Names and Apostrophes

    Phenomenal, completely changes how I can deal with strings containing patterns! No, if I can just get a handle on the pattern syntax...found this site: [link ]http://www.regular-expressions.info/reference.html[/url] Seems to be quite good for explaining patterns, as well as the other syntax...
  5. DougInCanada

    Hyphenated Names and Apostrophes

    thanks, strongm. Now I just have to try to figure out how to use regexp to capture Mc and Mac (ie: McDuff and MacDonald)....
  6. DougInCanada

    Hyphenated Names and Apostrophes

    Thanks to you both, each solution works really well. strongm, that's really interesting, it's my first encounter with regexp, seems like lots of useful opportunites, but how do I actually replace strLastName with the .replace results, rather than just display them in a message box? Cheers to...
  7. DougInCanada

    Hyphenated Names and Apostrophes

    Thanks, Geates, works great! Just to make it a little more challenging, how can I change it to detect more than one apostrophe in a hyphenated name (ie: O'Reilly-O'Shea)?
  8. DougInCanada

    Hyphenated Names and Apostrophes

    I have a script for creating user accounts which makes the first letter of a name uppercase and the rest lowercase: intLastName = Len(strLastName) strFirstLetter = UCase(Left(strLastName, 1)) strRemainingLetters = LCase(Right(strLastName, intLastName - 1)) strLastName = strFirstLetter &...
  9. DougInCanada

    changing the Account User Logon Name for an AD User Object

    Thanks, JPJ, omitting UserPrincipleName would have been a serious oversight! Much appreciated, Doug
  10. DougInCanada

    changing the Account User Logon Name for an AD User Object

    My Bad...sAMAccountName IS the donain logon name account. "Jimmy Hoffa" is the DistinguishedName...Answered my own question...
  11. DougInCanada

    changing the Account User Logon Name for an AD User Object

    After creating a user object with a Distinguished Name ie: Set objOU = GetObject("LDAP://OU=Company Users,dc=domain,dc=com") Set objUser = objOU.Create("User", "cn=Jimmy Hoffa") objUser.Put "sAMAccountName", "Jimmy Hoffa") objUser.SetInfo How do I set his Account domain Logon Name (ie...
  12. DougInCanada

    add a mailbox to a 2010 Exchange server

    I guess what I'm really after is a VBS alternative to the PS Command "Enable-Mailbox john@contoso.com -Database Sales"
  13. DougInCanada

    add a mailbox to a 2010 Exchange server

    I'm trying to create a script to create / add a mailbox to a specific mailbox DB on Exchange 2010 for a user object which I created from a script, but I have no idea where to begin. Can someone point me in the right direction? All assistance will be supremely appreciated! Cheers
  14. DougInCanada

    remove a user object from all groups they are a member of except Domain Users

    OK... So this is where I am now: I have the follwing code: [strLDAP is already valid and defined in the code several lines above this segment] Set objUser = GetObject(strLDAP) intPrimaryGroupID = objUser.Get("primaryGroupID") arrMemberOf = objUser.GetEx("memberOf") For Each Group...
  15. DougInCanada

    remove a user object from all groups they are a member of except Domain Users

    Geates, I might have stumbled onto something. Apparently, the MemberOf attribute is a backlink attribute and therefore readonly. [link]http://directory.toxz.net/topic/2/21/08-re-setinfo-causes-80072035[/url] You can't modify memberOf because it is a backlink attribute and they are calculated...

Part and Inventory Search

Back
Top