| Topic |
 |
RE: Using new 2008 R2 AD cmdlets to eumerate group membership and create custom object to organize tha works too, but i ended up doing with the hash table and it works great: $OU = "OU=UserOU,OU=BaseOU,DC=fabrikam,DC=com" $timeStamp = get-date $dataArray = @() Get-ADGroup -ldapfilter "(cn=*)" -SearchBase $OU -searchscope subtree -prop ... by ebrown35 in Active Directory on 08 Jun 2010 10:07 AM
|
 |
Using new 2008 R2 AD cmdlets to eumerate group membership and create custom object to organize So I was task with writing a script that would enumerate all the groups in an OU along with any nested groups and output to a .csv with column header that read AD User, AD Group and Timestamp. The timestamp is simply a get-date that take a timestamp ... by ebrown35 in Active Directory on 29 Apr 2010 02:01 PM
|
 |
RE: get-wmiobject and for inventory how about pointing to an OU an running the same script instead of using th input file, that can be accomplished by building a variable and using a foreach against it, correct? by ebrown35 in General PowerShell on 16 Mar 2010 11:05 AM
|
 |
RE: get-wmiobject and for inventory oh wow, cool I never thought of building the script and output that way, thanks! by ebrown35 in General PowerShell on 16 Mar 2010 09:44 AM
|
 |
RE: get-wmiobject and for inventory I am have tried it several different ways (using -class) and I get: Get-WmiObject : Invalid parameter At line:3 char:25 + $server | Get-WmiObject :\quiz\results\.csv" -noType + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], Management ... by ebrown35 in General PowerShell on 16 Mar 2010 07:49 AM
|
 |
get-wmiobject and for inventory I am using get-wmiobject to inventory certain items in a server list stored in .csv. I need service tag, etc. This seems like it should work for just to pull the computer name and sp, but I must be missing something: Import-Csv C:\server_list.csv | ... by ebrown35 in General PowerShell on 15 Mar 2010 06:21 PM
|
 |
RE: Adding users to groups from two headers in .csv Thanks again, I really am starting to get a handle on this. by ebrown35 in Active Directory on 04 Dec 2009 08:03 AM
|
 |
RE: Adding users to groups from two headers in .csv Thanks Shay! Is there a way for it tow work if the group cloumn has more thatn one group in it? by ebrown35 in Active Directory on 03 Dec 2009 09:43 AM
|
 |
Adding users to groups from two headers in .csv Ok I have a .csv that contains samaccountname and a group DN for a list of users:User Groupuser1 ' CN=group1,OU=subcompany,OU=Exchange,DC=Fabrikam,DC=com'user2 ... by ebrown35 in Active Directory on 02 Dec 2009 01:04 PM
|
 |
RE: export proxyaddresses for a list of groups Posted By Shay on 02 Dec 2009 05:36 AM By the way, what Exchange version? The above is for 2003. Yes, 2003. by ebrown35 in Active Directory on 02 Dec 2009 05:40 AM
|
 |
RE: export proxyaddresses for a list of groups Well I wanted to have the ouput in similar format as in the post above:user1,proxy1 user1,proxy2 user1,proxy3 user1,proxy4 user2,proxy1 user2,proxy2 user2,proxy3 user2,proxy4 by ebrown35 in Active Directory on 02 Dec 2009 05:25 AM
|
 |
RE: export proxyaddresses for a list of groups Import-Csv C:\scripts\users_backup.csv | Get-QADUser -Identity {$_.SamAccountName} | Foreach-Object{ $g = $_.name $_.proxyaddresses | select @{n="User";e={$g}},@{n="ProxyAddress";e={$_}} } why doesn't the above work, it seems that it should but it r ... by ebrown35 in Active Directory on 01 Dec 2009 02:30 PM
|
 |
RE: export proxyaddresses for a list of groups Is there a way to adapt this to users? I have tried to no avail. by ebrown35 in Active Directory on 01 Dec 2009 12:36 PM
|
 |
RE: Remove all proxyaddress and group membership except 'domain users' This is for removing the secondary proxyaddresses: $Users = ([ADSI]LDAP://OU=users,OU=,DC=fabrikam,DC=com").PsBase.Children ForEach ($User in $Users) { $User.Get("proxyAddresses") | ` ?{ $_ -CLike "smtp:*" } | ` %{ $User ... by ebrown35 in Active Directory on 23 Nov 2009 12:28 PM
|
 |
RE: Remove all proxyaddress and group membership except 'domain users' shouldn't this work: $user = Get-QADUser -SearchRoot "OU=users,OU=,DC=fabrikam,DC=com" -SizeLimit 0 foreach ($user in ($user)){(get-qaduser $user).memberof | Get-QADGroup | where {$_.name -ne "domain users"} | Remove-QADGroupMember -member $user } by ebrown35 in Active Directory on 23 Nov 2009 12:27 PM
|
 |
RE: Remove all proxyaddress and group membership except 'domain users' I have this script to remove group membership:foreach ($user in (get-content users.txt)){(get-qaduser $user).memberof | Get-QADGroup | where {$_.name -ne "domainusers"} | Remove-QADGroupMember -member $user -whatif}but I need to modify it to use get ... by ebrown35 in Active Directory on 17 Nov 2009 09:57 AM
|
 |
Remove all proxyaddresses and group membership except 'domain users' I have a user base that exist in one OU, we’ll call it:OU=users,OU=,DC=fabrikam,DC=com I need to remove all proxyaddress (not the x.400, x.500, just the lowercase smtp addresses) and remove all group memberships from these except 'domain users' in o ... by ebrown35 in Active Directory on 23 Nov 2009 12:33 PM
|
 |
RE: Remove an smtp address from a group of users. I acutally ran this in production last weekend and it removed all proxy addresses, which was not the desired effect, and in 3 cases removed all emaill addressess, so I am going to try to tweek it a little more. I did find this script for use with Ex ... by ebrown35 in Exchange Server on 05 Aug 2009 07:48 AM
|
 |
RE: export proxyaddresses for a list of groups This worked great, is there another way that you could list each proxyaddress on its on line with the the group repeated for each address like this: group1,proxy1 group1,proxy2 group1,proxy3 group1,proxy4 group2,proxy1 group2,p ... by ebrown35 in Active Directory on 31 Jul 2009 07:17 AM
|
 |
RE: Import groups and export DN Shay I found one of your examples in another thread and made on small modification: Import-Csv C:\scripts\delete_groups.csv | Get-QADGroup -Identity {$_.Name} | foreach { $group = $_ $group | Get-QADGroupMember | select Name,SAMAccountName,Descripti ... by ebrown35 in Active Directory on 31 Jul 2009 07:06 AM
|
 |
export proxyaddresses for a list of groups Import-Csv C:\scripts\groups_backup.csv | Get-QADGroup -Identity {$_.GroupName} | Select-Object SamAccountname,proxyaddresses | Export-Csv "C:\scripts\groups\cox_backup.csv" But it returns this: System.Object[] for the proxyaddresses v ... by ebrown35 in Active Directory on 30 Jul 2009 01:59 PM
|
 |
RE: Import groups and export DN Yeah Shay there was an incorrect group name in the.csv towards the bottom of the list that was causing it to fail, once I resolved that everything was fine. Now I have to export the members of each one of the groups on the C:\scripts\delete_groups.c ... by ebrown35 in Active Directory on 30 Jul 2009 11:54 AM
|
 |
RE: Import groups and export DN Get-QADGroup : Cannot validate argument on parameter 'Identity'. The argument cannot be null or empty.At line:1 char:23+ Get-QADGroup -Identity + CategoryInfo : InvalidData: (:) [Get-QADGroup], ParameterBindingValidationExceptio ... by ebrown35 in Active Directory on 22 Jul 2009 08:04 AM
|
 |
RE: Import groups and export DN that returned a similar error:Get-QADGroup : The (&(objectClass=*)(sAMAccountName=TSR))) search filter is invalid.At line:1 char:64+ Import-Csv C:\scripts\delete_groups.csv | Foreach {Get-QADGroup seDefaultIncludedProperties -IncludedProperties dn | ... by ebrown35 in Active Directory on 22 Jul 2009 07:43 AM
|
 |
Import groups and export DN Import-Csv C:\scripts\delete_groups.csv | Get-QADGroup -Identity {$_.SamAccountName} -SizeLimit 0 -DontUseDefaultIncludedProperties -IncludedProperties dn | Select-Object dn | Export-Csv -Path "C:\scripts\delete_groups_dn.csv"The script above is re ... by ebrown35 in Active Directory on 22 Jul 2009 07:26 AM
|
 |
RE: Remove an smtp address from a group of users. I forgot to mention that they are DLs so I made the following changes and it works great, thanks!Import-Csv C:\scripts\custom_user.csv | Foreach-Object { $user = Get-QADGroup $_.UserName -IncludedProperties proxyAddresses $pa = $user.proxyaddresses ... by ebrown35 in Exchange Server on 20 Jul 2009 09:14 AM
|
 |
RE: Remove an smtp address from a group of users. Thanks, Shay. I got these errors when I ran the code above: Get-QADUser : The argument cannot be null or empty. At line:2 char:20 + $user = Get-QADUser Set-QADUser : The argument cannot be null or empty. At line:4 char:12 + Set-QADUser <<< ... by ebrown35 in Exchange Server on 20 Jul 2009 08:24 AM
|
 |
RE: Remove an smtp address from a group of users. I found a way using set-mailbox, but that cmdlet is not supported on Exchange 2003. by ebrown35 in Exchange Server on 17 Jul 2009 08:38 AM
|
 |
Remove an smtp address from a group of users. How can remove a particular smtp address in AD from a group of users read from a .csv file? I am running Server 2003/Exchage 2003. I know I will start it like this: Import-CSV "C:\scripts\custom_user.csv" | ForEach by ebrown35 in Exchange Server on 16 Jul 2009 02:19 PM
|