![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Reading from Txt file to create multiple mail enabled DLs Hello all, Here is my question. I've used this script to create a single mail enabled universal distribution list and it works fine. We are still running E2K3 and wont be switching for awhile. I've been beginning to get more requests to create multiple mail enabled groups and want to try and have it read from a text file and try to use the for each method, but I'm afraid if I have them listed not sure how it will pick up the "strName" and the rest of the info correctly? I thought about trying to use the string variables, but not sure how it will actually work? I suppose I could have each entry listed as "CN=DL ZZ Mail Users" and keep adding them in the text file, but what I'm afraid if I use objGroup.Put displayName it will come out as CN=DL ZZ Mail Users, and same with sAMAccountName. Then trying to figure out how to string to remove all spaces from $strName to create the mailNickName and mail... If anyone has any suggestions besides using Quest's ActiveRoles Shell, as I'm trying to use just powerShell command shell. Once I figure this portion out, I can retain some of the code to also export users from DLs and perhaps import to DLs for the larger member lists... Any help would be appreciated... Thanks, and sorry if the script is a little raw or makes no sense...I'm still learning. joseg $strDomain = "DC=hrc,DC=root,DC=loc" # Domain variable $strClass = "Group" # Group variable $intGroupType = 8 # defines type as a Universal distribution list $strName = "CN=DL ZZ Mail Testing" # distribution list Name variable $objADSI = [ADSI]"LDAP://OU=Distribution Lists,OU=Region-US,DC=hrc,DC=root,DC=loc" $objGroup = $objADSI.create($strClass, $strName) $objGroup.Put("GroupType",$IntGroupType) $objGroup.Put("displayName","DL ZZ Mail Testing") $objGroup.Put("mailNickname","DLzzMailTesting") $objGroup.Put("sAMAccountName","DL ZZ Mail Testing") $objGroup.Put("mail","dlzzMailTesting@xxxxxx") $objGroup.SetInfo() |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Reading from Txt file to create multiple mail enabled DLs Quote: > I'm trying to use just powerShell command shell. Remember, powershell.exe is a .NET based automation tool. So perhaps one means by just automating the .NET classes themselves, just like one also automates tools (COM and etc.) within the Windows admin's automation tool, powershell.exe! Anyway, have fun automating all kind of objects and tools, even the .NET classes, within the Windows admin's automation tool, powershell.exe! |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Windows Live Mail--Create multiple IMAP folders/move mail in batch | Live Mail | |||
| Multiple identities -- will they be re-enabled? | Vista mail | |||
| How to create multiple windows mail database files | Vista mail | |||
| Vista Media Center won't display with multiple displays enabled. | Vista General | |||
| Reading mail on multiple computers | Vista mail | |||