Here is the script that will export all distribution groups in the file groups.txt and then will put these groups and their members in the file membership.txt:
dsquery * forestroot -filter "(samAccountType=268435457)" -limit 0 > groups.txt
for /f "tokens=*" %%g in (groups.txt) do @echo %%g >>membership.txt && echo Members: >>membership.txt && dsget group %%g -members -expand >>membership.txt && echo **************************************** >>membership.txt
If you want to do a query on security groups, or on distribution groups that have managers assigned and then list their members, please see my other posts from the Scripts categories called Distribution lists and managers and Security and distribution groups and easily modify the upper script.
Thursday, January 29, 2009
Microsoft Web Platform Installer is now released
The Web Platform Installer (Web PI) is a simple tool that installs Microsoft's entire Web Platform, including IIS, Visual Web Developer 2008 Express Edition, SQL Server 2008 Express Edition and the .NET Framework. Using the Web Platform Installer’s user interface, you can choose to install either specific products or the entire Microsoft Web Platform onto your computer. The Web PI also helps keep your products up to date by always offering the latest additions to the Web Platform.
Supported Operating Systems are: Windows Vista RTM, Windows Vista SP1, Windows XP, Windows Server 2003, Windows Server 2008.
See here: http://www.microsoft.com/web/channel/products/WebPlatformInstaller.aspx
Supported Operating Systems are: Windows Vista RTM, Windows Vista SP1, Windows XP, Windows Server 2003, Windows Server 2008.
See here: http://www.microsoft.com/web/channel/products/WebPlatformInstaller.aspx
Friday, November 21, 2008
Add mobile number to 1000 users
Hi all,
This is a script i wrote it in a response to a question asked by someone in Microsoft newsgroups:
how to add mobile numbers easily to 1000 users?
Let's assume that you have the users in a file named mobile.txt formatted like this:
User Phone number
Jon Kerry 0743221021
.
.
The first column is the name of the user, the second column is his mobile number (separated by a tab). The following script would do the trick:
For /F "Tokens=1,* Delims= " %%A In (mobile.txt) Do (
Set name=%%A
Set mobile=%%B)
dsquery user -name "%name%" dsmod user -mobile %mobile%
Pay attention that after Delims= it is a tab character.
This is a script i wrote it in a response to a question asked by someone in Microsoft newsgroups:
how to add mobile numbers easily to 1000 users?
Let's assume that you have the users in a file named mobile.txt formatted like this:
User Phone number
Jon Kerry 0743221021
.
.
The first column is the name of the user, the second column is his mobile number (separated by a tab). The following script would do the trick:
For /F "Tokens=1,* Delims= " %%A In (mobile.txt) Do (
Set name=%%A
Set mobile=%%B)
dsquery user -name "%name%" dsmod user -mobile %mobile%
Pay attention that after Delims= it is a tab character.
Essential LDAP attributes
In the general tab, these are the ldap attributes (in the second column are the corresponding ldap attributes):
First name: givenname
Initials: initials
Last name: sn
Description: description
Display name: displayname
Office: physicalDeliveryOfficeName
TelephoneNumber: telephoneNumber
Webpage: wWWHomePage
E-mail: mail
In the address tab:
Street: streetAddress
P.O. Box: postOfficeBox
City: I
State: st
Zip code: postalCode
Country: co
In the account tab:
User logon name: UserPrincipalName
User logon name (pre Windows 2000): sAMAccountName
Account expires: accountExpires
In the profile tab:
Profile path: profilePath
Logon script: scriptPath
Home folder, drive: homeDrive
Home folder, local path: homeDirectory
In the telephones tab:
Home: homePhone
Pager: pager
Mobile:mobile
Fax: facsimileTelephoneNumber
Ip Phone: ipPhone
Notes: Info
In the organization tab:
Title: title
Department: department
Company: company
Manager: manager
Thursday, October 9, 2008
Distribution lists and managers
Another 2 useful scripts:
Find distribution lists and their managers:
dsquery * -filter "(&(samAccountType=268435457)(managedBy=*))" -Attr sAMAccountName managedBy -Limit 0
Find all groups which have managers:
dsquery * -filter "(&(objectclass=group)(managedBy=*))" -Attr sAMAccountName managedBy -Limit 0
Find distribution lists and their managers:
dsquery * -filter "(&(samAccountType=268435457)(managedBy=*))" -Attr sAMAccountName managedBy -Limit 0
Find all groups which have managers:
dsquery * -filter "(&(objectclass=group)(managedBy=*))" -Attr sAMAccountName managedBy -Limit 0
Subscribe to:
Comments (Atom)