![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Can I Modify ADSI with Powershell??? Hello. I'm trying to script adding additional UPN suffixes using Powershell but can't seem to find a way to do it. I've found vb scripts that show appending data into the partition table in AD, but nothing for Powershell. Any help would be appreciated. |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Can I Modify ADSI with Powershell??? Dan wrote:
http://blogs.msdn.com/arulk/archive/...25/678137.aspx There are others out there, as well as some discussion in this newsgroup, you might want to try searching the archives. -- Hal Rottenberg blog: http://halr9000.com powershell category: http://halr9000.com/article/category...ng/powershell/ | ||||||||||||
| | #3 (permalink) | ||||||||||||
| Guest | RE: Can I Modify ADSI with Powershell??? Can you post a link to a VBscript example & I'll see if I can convert it -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "Dan" wrote:
| ||||||||||||
| | #4 (permalink) | ||||||||||||
| Guest | Re: Can I Modify ADSI with Powershell??? This should do it for you. It worked for me ![]() function Add-USNSuffix{ Param($usn) $root = [ADSI]"LDAP://rootDSE" $conf = [ADSI]"LDAP://cn=partitions,$($root.configurationNamingContext)" $conf.uPNSuffixes += $usn $conf.psbase.commitchanges() } "Dan" <Dan@xxxxxx> wrote in message news:EDF5AAD2-2373-4330-8A09-64946A4B52DB@xxxxxx
| ||||||||||||
| | #5 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Can I Modify ADSI with Powershell??? Thanks. So I just set the $usn variable in the formula below correct? Do I need to set the rootDSE or does it find it itself? "Brandon Shell" wrote:
| ||||||||||||||||||||||||
| | #6 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Can I Modify ADSI with Powershell??? It should "find itself" but if it does not you can use the full path $root = [ADSI]"LDAP://My.Domain.Name/rootDSE" "Dan" <Dan@xxxxxx> wrote in message news:E025C995-02BB-471C-BBD7-ECCA6DA281EF@xxxxxx
| ||||||||||||||||||||||||||||||||||||
| | #7 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Can I Modify ADSI with Powershell??? I tried this, but it never updates anything. I tried a test scripts that looks like this: Param($usn) $usn = "test.com" $root = [ADSI]"LDAP://rootDSE" $conf = [ADSI]"LDAP://cn=partitions,$($root.configurationNamingContext)" $conf.uPNSuffixes += $usn $conf.psbase.commitchanges() Nothing gets modified though. Any suggestions? "Brandon Shell" wrote:
| ||||||||||||||||||||||||||||||||||||
| | #8 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Can I Modify ADSI with Powershell??? I've got it working now. I used this instead: $usn = "test.com" $root = [ADSI]"LDAP://rootDSE" $conf = [ADSI]"LDAP://cn=partitions,$($root.configurationNamingContext)" $conf.uPNSuffixes += $usn $conf.SetInfo() Thanks for the help! "Dan" wrote:
| ||||||||||||||||||||||||||||||||||||
| | #9 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Can I Modify ADSI with Powershell??? Dan, f.y.i. Brandon did make it into a function for easy of use, after loading this function one, you can just run this function with the new USN name. e.g. in your case this would loook like : Add-USNSuffix test.com it's was not ment or needed to add the USN name hardcoded h.t.h. Greetings /\/\o\/\/ "Dan" <Dan@xxxxxx> wrote in message news:C53D127A-669D-4525-9DB4-ACD1EF4E8850@xxxxxx
| ||||||||||||||||||||||||||||||||||||
| | #10 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Can I Modify ADSI with Powershell??? Thanks MoW... I will make a point to clarify that next time ![]() "/\/\o\/\/ [MVP]" <mow001@xxxxxx> wrote in message news:OidLjvr8HHA.5160@xxxxxx
| ||||||||||||||||||||||||||||||||||||
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Accessing Exchange 5.5 hidden recipients with PowerShell ADSI | Dan Roberts @ Kent State | PowerShell | 1 | 07-22-2008 02:35 PM |
| Modify PowerShell prompt when running as admin | Marc Scheuner | PowerShell | 2 | 10-14-2007 02:41 PM |
| error when using adsi | laurent | PowerShell | 2 | 03-20-2007 11:43 AM |
| Is it possible to modify keymgr.dll entires via powershell? | tugay | PowerShell | 0 | 11-28-2006 03:45 PM |
| ADSI Documentation? | Jim Holbach | PowerShell | 3 | 10-15-2006 08:01 PM |