Occasionally it can be useful to know how to retrieve the parent, or OU holding an object, from Active Directory.
Perhaps the easiest way to do this is using the Parent property.
Continue reading ‘Returning the OU for an object in AD’ »
Archive for the ‘Active Directory’ Category
This script uses WMI and Active Directory queries to return information about mailbox sizes from Exchange and the limits set in Active Directory.
Download GetMailboxStatistics.vbs
A number of people have been looking for Get-MailboxStatistics for Exchange 2003. I have a PowerShell version of this script for exactly that reason here.
Continue reading ‘Exchange 2003: Returning mailbox sizes’ »
A script to read the mailbox security descriptor from Active Directory with the intention of finding a particular user or security principal. It will not display the security descriptor, it simply displays whether or not the account is present in the access control list.
Continue reading ‘Finding a user in Exchange mailbox security’ »
The VbScript below demonstrates how subnet information might be retrieved from Active Directory. It is possible to use a search using to return this information (for objectClass=subnet). This method connects to the subnets container and loops through the contents returning the network address and mask length in a Dictionary object.
Continue reading ‘VbScript: GetADSubnets’ »
This VbScript searches the current domain for all users with “User cannot change password”, “Password never expires”, or “Trusted for delegation” set, the results of the search are written to a tab delimited text file.
Continue reading ‘Auditing userAccountControl with VbScript’ »
I recently went through another migration. One of the post migration tasks was to fix permission to update lists. The “ManagedBy” attribute had been copied across, but not the security descriptor from the group.
This show PowerShell script can be run from the Exchange Management Shell to grab the value from ManagedBy and write it back to the security descriptor. It’s a little messy, especially as there’s no way to check on the AD level if the box is ticked except by the security descriptor.
Continue reading ‘Exchange 2007 & Manager Can Update Membership List’ »
This script will create contacts in Active Directory based on a formatted CSV file. It was written to allow automatic synchronisation of contacts using a CSV file as the source.
Continue reading ‘Import contacts from a csv file using VbScript’ »
These snippets of code shows how to search Active Directory using LDAP to return all domains in the current Forest (based on current authentication).
Continue reading ‘Listing all domains in a forest’ »
When it comes to testing for group membership in Active Directory with VbScript there are a lot of different options. The following examples intend to demonstrate the basic to the complex.
Continue reading ‘Active Directory, VbScript & testing group membership’ »
This small script will list all attributes listed in the Active Directory Schema which have been set to replicate into the Global Catalog. Inclusion in the Global Catalog is defined by setting the attribute “isMemberOfPartialAttributeSet” to True.
Continue reading ‘VbScript: isMemberOfPartialAttributeSet’ »