powershellscripts.com

PowerShell Logo


253 results found for the Active Directory Category in about 0.034 seconds
"Remote Server Administration Tools" Deployment using PowerShell
Hi,we are doing some active direcotry task on our environt. These "active directory" is going to be done on "New formatted Laptops". Our scripts are using Active Directory based cmdlets. So here the problem arise how can we install the "RSAT" tools automaticall and enable the "Ac
http://gallery.technet.microsoft.com/Remote-Server-Administratio-a4ffaf7e

Active Directory Health Script
Use this script daily or for trouble shooting
http://gallery.technet.microsoft.com/28812d92-30be-4f37-80cb-ab21b1eeaace

Active Directory Replication PowerShell Module 2.0
Managing Active Directory Sites, Site Links and Subnets very easily with PowerShell. Also checking the Active Directory Replication is easy and richer than repadmin.exe, the cmdlets in this module do return objects and not just text. So no more boring test parsing.
http://gallery.technet.microsoft.com/780a2272-06f9-4895-827e-9f56bc9272c4

Active Directory Snapshot Manager
This script is using Windows Forms and permit to manage Active Directory snapshot through a GUI to pilot NTDSUTIL snapshot functionnality and DSAMAIN.
http://gallery.technet.microsoft.com/Active-Directory-Snapshot-5de575d8

Active Directory to SQL
Description:A very simple powershell script to read recursively through an OU and write it's contents to a database for a friendlier reporting structure. Reason:I built this to provide a leverageable data set for reporting.  I have several tools that gather ad system information,
http://gallery.technet.microsoft.com/Active-Directory-to-SQL-43a59d1f

Active Directory to SQL
Description:Simple script to gather system object information from AD and write it to a DB.Reason:In spite of multiple tools that gather AD information, I required a steady up to date queryable source for system information.  Most importantly to determine system activity and use
http://gallery.technet.microsoft.com/Active-Directory-to-SQL-e5ac0384

Active Directory'de Bilgisayar hesaplarindaki prestaging degerlerini temizlemek.
Eger prestaged bilgisayarlara ait RemoteInstall/GUID degerlerini Active Directory'den temizlemek isterseniz asagidaki powershell komutlarindan yararlanabilirsiniz.  Bu deger bilgisayar hesabi (Computer Account) ozelliklerinde Remote Install tab'in da gosterilen GUID degeridir, bu
http://gallery.technet.microsoft.com/Active-Directoryde-e2c94537

ActiveDirectoryManagement.ps1
A group of functions that can be used together to work with an Active Directory domain.
http://gallery.technet.microsoft.com/3cc670ca-9ddf-45b4-860c-9dec35f33d20

AD Management Module
This is module for managing Active Directory without using 3rd party software and without using Cmdlets from Microsoft. Written using mostly ADSI
http://gallery.technet.microsoft.com/AD-Management-Module-94104158

AD Password Tool - Updated

http://gallery.technet.microsoft.com/AD-Password-Tool-68804bab

AD Termination powershell script
This script allows automation of users termination in active directory. This script takes list of users from csv file, remove user group membership, clear manager property in active directory, hide it from global address list and move it to disabled users OU. Enjoy.
http://gallery.technet.microsoft.com/83691ca6-c564-4e45-8d44-04a08dfa90c0

AD User Creation tool (v.0.2)
One task that every systems administrator has to go through at some point is the creation of new user accounts. Powershell makes this process simple and adds additional functionality, such as the ability to set defaults and import users from CSV.
http://gallery.technet.microsoft.com/New-User-Creation-tool-14fa73cd

AD/DNS Convergence Check (cmd file)
This cmd file provides a means of verifying that a newly created DNS server has completed the replication of content from an assumed/known-good 'source' DNS server.
http://gallery.technet.microsoft.com/13f4b2f6-b410-4def-a603-8cb3ff8fa575

Add sidHistory
This script is designed to copy the SID of a user in a source domain to the sidHistory of a user in a target domain.
http://gallery.technet.microsoft.com/9b338347-c012-418b-84f6-efc5a148429b

ADInactiveMover
Reports inactive computers from target OUs and has options to move them to a targeted OU.
http://gallery.technet.microsoft.com/c53b9278-877b-4720-a9f2-8938b8cd479d

ADSchemaExtensionConflictAnalyzer.ps1
Analyzes the .ldf files of an Active Directory schema extension for conlicts. The schema extension is compared to a production or test schema. The results are reported on screen and in an output file. Potential schema conflicts are commented in the output.
http://gallery.technet.microsoft.com/0672d181-ab2c-4c92-8466-d93a67412207

Auto Disable Delete stale user accounts in A/D
Allows you to automatically go through A/D and Disable / Delete accounts
http://gallery.technet.microsoft.com/3a2377e0-4471-4eba-9dbd-5cfb9a4fdb28

Backing up/Archiving Security Event logs to CSV (OLD)

http://gallery.technet.microsoft.com/a044e315-78e3-4d78-b2eb-d7a806a05794

Check Password Replication
This script uses Microsoft RepAdmin to check the password replication of a user’s account across all domain controllers in the current domain.
http://gallery.technet.microsoft.com/85bca10a-b40c-4fab-86d3-d99f4732ae94

Checking Active Directory User
Checks Active Directory User in DC
http://gallery.technet.microsoft.com/ab137ae7-e674-407e-87d3-8f76d4cfccb0

Connect to Domain

http://gallery.technet.microsoft.com/c0fcf126-b775-4288-88ed-49065ef65103

Convert Foreign Security Principals to SAM Account Names
This function is part of a library of Active Directory functions that I created a while back. This function now works the way you think it should. It accepts an FSP name property from the pipeline and outputs the DOMAIN\Username and name property.
http://gallery.technet.microsoft.com/Convert-Foreign-Security-1fdbaf46

Copy-GroupMembership.ps1
This script will copy group membership between two accounts. The primary use is for the creation of new studentn workers to replace outgoing workers. This script automates the group updates for that.
http://gallery.technet.microsoft.com/Copy-GroupMembershipps1-44057e11

copyAD Suite - export-Groupmembers

http://gallery.technet.microsoft.com/copyAD-Suite-Groupmember-ae4559cf

copyAD Suite - Export-Groups

http://gallery.technet.microsoft.com/copyAD-group-eport-63af7130

copyAD Suite - Export-OUs

http://gallery.technet.microsoft.com/copyAD-Suite-OU-Export-4acee839

copyAD Suite - export-Users

http://gallery.technet.microsoft.com/copyAD-suite-User-Export-6c5ac0d1

copyAD Suite - Import-GroupMembers

http://gallery.technet.microsoft.com/copyAD-Suite-GroupMember-1431a984

copyAD Suite - Import-Groups

http://gallery.technet.microsoft.com/copyAD-suite-Group-Import-88687217

copyAD Suite - Import-OUs

http://gallery.technet.microsoft.com/copyAS-Suite-OU-Import-23413444

copyAD Suite - Import-Users

http://gallery.technet.microsoft.com/copyAD-Suite-User-Import-c3c7dbf1

Count Objects in Active Directory

http://gallery.technet.microsoft.com/Count-Objects-Active-2001cb32

Create Active Directory Computer Object
This code demonstrates how to create a new computer object on Active Directory without any plug-ins.
http://gallery.technet.microsoft.com/238d9716-65d2-4ab4-8045-eed1b20d8fca

Create Active Directory Group Object

http://gallery.technet.microsoft.com/8ce449e0-e8e1-453a-9545-daf6ea23b01b

Create Active Directory User Object
This code demonstrates how to create a User Object on Active Directory without any plug-ins.
http://gallery.technet.microsoft.com/673a3c9b-5f7f-4c76-be6d-0ffe7aa16aca

Create an Active Directory User Account
Creates an Active Directory user account, including mailbox, home directory ( and permissions), and profile directory (and permissions), as well as several other attributes. The
http://gallery.technet.microsoft.com/7b8751cf-2db3-4837-bb90-4afbed66f40c

Creating IIS user on Active Directory
Creates IIS users on AD
http://gallery.technet.microsoft.com/d9a309e6-e297-410d-aab1-b9b2105ae1bb

Daily report - changed users in Active directory

http://gallery.technet.microsoft.com/99d62858-6939-4be0-8fc1-7dda5a8d35d3

Delete User Profile if not a Member of a Group
This is a powershell script to delete user profiles if they are not a member of global security group. Script determines if the user is member of the named group from the function that has been written by Richard Mueller. You can find his script here : http://gallery.technet.micr
http://gallery.technet.microsoft.com/Delete-User-Profile-if-not-6baeeb11

Delete-LocalAccount
This script searches ActiveDirectory for computer accounts, for each computer account it removes the specified user account.
http://gallery.technet.microsoft.com/52fc73a7-6423-4afb-8b9a-6759d1834e40

Disable USB Storage Drive
Script help to disable USB Storage Drive
http://gallery.technet.microsoft.com/462d77b8-b712-4840-80e9-bc5378eb3680

Disabled AD Account cleanup script
This powershell script searches a specified OU tree in AD for accounts that have been disabled longer than a certain period of time and then deletes them.  User accounts can be whitelisted from the cleanup process and once complete, the script compiles a nice HTML report and emai
http://gallery.technet.microsoft.com/Disabled-AD-Account-8cc92a7d

Display all Computer Accounts, organized by OU
Searches the current domain for computer accounts, reporting which OU contains them. Ignores built-in Computers container.
http://gallery.technet.microsoft.com/8966bf3e-5e8a-44a5-ab39-6d54c5f7f15e

Display all User Accounts, organized by OU
Searches the current domain for user accounts, reporting which OU contains them. Ignores built-in Users container.
http://gallery.technet.microsoft.com/658b7a11-d87f-4acc-8d51-bfb954900405

Email Active Directory Users with expiring passwords
This script finds user accounts with expiring passwords and sends a notification email with an attachment containing instructions. You will need to modify the Help Desk email address, log location and instructions document and location before implementing. 
http://gallery.technet.microsoft.com/Email-Active-Directory-452a5640

Enable, disable and/or delete multiple users in AD
Functions to disable or enable multiple Users in AD
http://gallery.technet.microsoft.com/7cc3895b-0dc0-4053-bcb2-ab82cea52d6c

Enumerate Active Directory User Object Information
This code demonstrates how to search and retrieve User Object information from Active Directory without any plug-ins.
http://gallery.technet.microsoft.com/64457a5a-677a-492d-ad6c-957b0997d1ba

Enumerate Inactive or Stale Active Directory User Objects

http://gallery.technet.microsoft.com/f2bac77e-905e-4970-9d93-920d3c1744bf

Extract arbitrary list of properties from AD user objects
Select a list of properties to be extracted from AD user object.This Advanced Function uses the DirectoryServices,DirectorySearcher class.  This makes it very fast and lightweight.  the [adsisearcher' is not eassily usable for many PowerSHellusers because it always wrps each prop
http://gallery.technet.microsoft.com/Extract-arbitrary-list-of-6f59d3b4

Find Circular Nested Groups
PowerShell script to find any instances of Circular Nested Groups in the domain.
http://gallery.technet.microsoft.com/fa4ccf4f-712e-459c-88b4-aacdb03a08d0

Find old computer objects
searches Ad for computer objects older than the date specified
http://gallery.technet.microsoft.com/7bc5bc1c-e934-4ce1-8a77-3b0105807402

Find-LocalAdmins
This script searches ActiveDirectory for computers. It then queries each computer for the list of users who are in the local Administrators group.
http://gallery.technet.microsoft.com/73311422-b96a-4672-807a-5ad27db23f0d

Generate a random list of UserNames into a CSV file
For creating Demo environments. With two lists of Names (First and Last) it creates a csv file for importing
http://gallery.technet.microsoft.com/9d7b6833-438e-4e1c-a4e7-cabcc17ec03b

Generate Random Passwords
This is a Simple Function to Generate Random Passwords with Varying levels of complexity
http://gallery.technet.microsoft.com/d34e94fc-9c06-4499-bcf7-4491f2e4abf8

Generic Search of Active Directory
A PowerShell Version 1.0 script to search Active Directory. The program prompts for the base of the query, the LDAP syntax filter, and a comma delimited list of attribute values to retrieve. Results are in list or comma delimited format.
http://gallery.technet.microsoft.com/Generic-Search-of-Active-0a05b8d0

Get Active Directory - user information report summary Get-ADUser

http://gallery.technet.microsoft.com/f3d907e4-2438-4aff-9370-238b7a787d35

Get all DC information from Forest with domainadmin credentials.
This scripts connects to Active Directory Forest and gets DomainController object information like (name, Ram,Disk,Roles,IP,GC,Sitename,OSVersion, lastbootuptime) exporting them to CSV file which can be easily viewed in excel
http://gallery.technet.microsoft.com/72cfbd54-c76d-4566-b513-8ef5274bbb0b

Get basic AD Objects properties without PS AD Module

http://gallery.technet.microsoft.com/Export-AD-Users-properties-eea93c89

Get Last Logon of Users
This script returns the last logon time of users in Active Directory
http://gallery.technet.microsoft.com/c69303e3-7978-4c5a-bf28-e55e9a71082c

Get paged AD Objects
The script allow to get Active Directory users properties (or any other object type). The main advantage of the script is using page result request control that allow to get a large batch of objects (for example more than a 1000) and don’t see "Sizelimit exceeded".
http://gallery.technet.microsoft.com/Get-paged-AD-Objects-64519ce6

GET user lastlogontime into CSV file
this script connects to AD and calculates the last logon time for the users you specify and outputs them into a CSV file
http://gallery.technet.microsoft.com/563ed753-f1a2-40e7-b0cd-91fa50d6a20b

Get User's Distinguished Name
Get the DN for a user account from AD.
http://gallery.technet.microsoft.com/f7b246a4-95a2-4408-b1a1-73b53003883c

Get-AD
Retrieves information from Active-Directory
http://gallery.technet.microsoft.com/81865fd8-6bdf-44d6-844b-01f262dc853e

GET-ADUserStatus
Query Active Directory and Show status of a named User using Server 2008R2
http://gallery.technet.microsoft.com/6a0b7901-7277-4059-b998-5bf737bb259a

Get-Canonical Name
A Powershell Function to convert a String containing a Distinguished Name (CN=John,OU=People,DC=Contoso,DC=local) to a CN (Contoso.local/People/John)
http://gallery.technet.microsoft.com/04e4e149-519a-4834-9626-02275de57ea6

Get-DomainControllers
Use this script to list all of the domain controllers in the environment.
http://gallery.technet.microsoft.com/b2547a5b-39d9-48ce-b6e2-bf4c452b1993

Get-FSMORoleOwner
This advanced function will get all FSMO role owners for each domain in a forest. Returns an object listing each FSMO role owner.
http://gallery.technet.microsoft.com/1502dead-58d3-4e89-aaea-b73f402d4d57

Get-UserComputerName
Once you have 'Auditing Account logon attempts' for you Domain Controllers - this can be done via GPO, This script will search the security event log for event 4768. The event is a Kerberos Ticket request. The event records the user and computer.
http://gallery.technet.microsoft.com/6f26a2d2-3ae3-4bb1-91d9-02ef8938f43e

Getting Active Directory Information
Gets Active Directory Domain Name, FQDN, Netbios..
http://gallery.technet.microsoft.com/2ec4405b-6043-4fb1-977c-60c66716a48d

Group membership audit
This script pastes groups across the columns and users down the rows and places an 'x' in every intersection where the user is a member of the group.
http://gallery.technet.microsoft.com/d5c6b119-0337-4b5d-93f3-c409c6cf7a45

How to clear prestaging property from computer objects via Powershell
If you need to clear RemoteInstall GUID (NetbootGUID) property from computer accounts in Active Directory you can use Powershell to do that very easily.
http://gallery.technet.microsoft.com/How-to-clear-prestaging-651d8b17

Identify Domain Membership
Here is a PowerShell script which you can use to identify the domain membership of remote computers . You can use a text file as an input file with all your computers names. This script generates 2 output files; Domain_Success_File.txt and Domain_Failed_File.txt.
http://gallery.technet.microsoft.com/2ef5d430-a677-4445-9890-a5a95f4b0bd9

Identify Last Logged-On User / DefaultUserName
This script generates Last Logged-On User / DefaultUserName information from an input file (input.csv) which contains computer names.
http://gallery.technet.microsoft.com/71df2682-1bfd-4adf-af6c-25fb9705f979

Import users in Active Directory from CSV file
Import users and theirs passwords in Active Directory. The CSV file must contain Firstname, Name and password.
http://gallery.technet.microsoft.com/ed20b349-9758-4c70-adc0-19c5acfcae45

Invoke-ADMTUserMigration

http://gallery.technet.microsoft.com/5e1169be-9201-4d5f-8850-0a97c75dcdb1

Join a computer to a domain

http://gallery.technet.microsoft.com/Join-a-computer-to-a-domain-6e19d905

List all Computer Accounts in your Domain from Active Directory (Powershell)

http://gallery.technet.microsoft.com/7d96b296-77a0-4d17-9ab8-ca929b88e04a

List all Servers in a domain
Connects to the defaul domain, lists all devices with Operating System containing windows*server*
http://gallery.technet.microsoft.com/84926b1f-4bf0-4e9e-ad28-215212a88a26

List Domain Information
Returns information about the current Active Directory domain. This script requires both Windows PowerShell and the corresponding version of the .NET Framework. For more informat
http://gallery.technet.microsoft.com/3242df32-2f55-4ecf-9b4b-8ecc92d11b76

List Group Members in Active Directory
This script can be used to list group membership in Active Directory.
http://gallery.technet.microsoft.com/dcc9432e-d541-4be2-a39c-637c8d4c9fd0

List Inactive Computer Accounts in Active Directory
List computer accounts in Active Directory not used for XXX days
http://gallery.technet.microsoft.com/6b8163d1-5fae-43b5-a664-a2d1f6e1e2da

List Inactive Computer Objects (without 3. party module)

http://gallery.technet.microsoft.com/List-Inactive-Computer-7ce9335d

List members of Group in Active Directory
List members of Domain Admins Group in Active Directory
http://gallery.technet.microsoft.com/04aac40d-69ab-4c42-b6b1-097ce502a452

List Members of Large Group
A PowerShell Version 1.0 script to enumerate the direct members of a large Active Directory group. This script uses ADO range retrieval to overcome the limit of 1500 values that can be retrieved for a multi-valued attribute like the "member" attribute of a group.
http://gallery.technet.microsoft.com/List-Members-of-Large-Group-0eea0132

List Users that have not Logged on in xxx days (potentially Disable)
List users in Active Directory that have not logged on for XXX days - extra option to auto disable
http://gallery.technet.microsoft.com/83d39949-3e22-45ef-aaba-3a4e17341c5e

Load User Account Attributes into a Database
Loads selected user attributes to a SQL Server database. This script requires Powersmo (PowerShell Community Extension 1.1.1) and a SQL Server database with SMO locally installed.
http://gallery.technet.microsoft.com/33d2b335-985c-4c57-8ffb-0fe7805ca165

Menu based - Connect to Foreign Domain
Something others can take and build on. List of Foreign Domains to connect to. Good for field techs
http://gallery.technet.microsoft.com/a4bbf41f-406d-4286-81b9-c793bc84ac83

Migrate-ADMTUser

http://gallery.technet.microsoft.com/b98cc405-55d8-452f-aa62-b8bd7280cc9b

Modify Log On To (userWorkstations) Attribute
This PowerShell script can be used to update or modify the Log On To (userWorkstations) attribute in Active Directory.
http://gallery.technet.microsoft.com/145213a1-0e5f-41fd-8fe6-119f989c792f

Modify Log On To (userWorkstations) - Supports Multivalue - PowerShell Script
This is an updated version of one of my old scripts - http://gallery.technet.microsoft.com/scriptcenter/145213a1-0e5f-41fd-8fe6-119f989c792f
http://gallery.technet.microsoft.com/852fe273-03ed-449f-8591-57b655cba82e

Monitor Active Directory OU for changes in Membership
This will log any computers added or removed from a particular set of OU's in Active Directory.
http://gallery.technet.microsoft.com/5bc995d2-6b6f-483c-a926-c4fa4d22aaed

Monitor Groups in an OU in AD for changes on Group Membership (Updated)

http://gallery.technet.microsoft.com/bfa06e91-a6d0-4d41-ab6d-eb7fd19c1704

New Email User (Exchange 2007) - Single Custom Email
Script creates new User in Exchange 2007, disables Email address policy, stamps only ONE custom email address
http://gallery.technet.microsoft.com/44a9de48-3286-4992-81c6-20dc3a45f071

New Exchange 2007 account from existing in AD

http://gallery.technet.microsoft.com/0de632f2-9c7b-497f-9e57-afbd6e924c38

New User - Non Exchange Active Directory Quest
Imports list of users from CSV file, creates them in Active Directory. Does NOT populate Exchange
http://gallery.technet.microsoft.com/75b80999-b17a-40f1-b611-9e0c0a7fa5d0

New User in A/D, Exchange, OCS, Home Folder
It prompts for First name, Last name and a password. It creates A/D account, sets various fields, enables OCS Standard, Home Folder and permissions. Requires Exchange 2007 and Quest Active Roles.
http://gallery.technet.microsoft.com/b16c4e22-67ed-4f57-87df-6c9069f13f9e

Password Generator Form
Creates a form that allows you to generate a random password based on the requirements listed within the code. Can then print out the form to give to user. Password also saved to clipboard.
http://gallery.technet.microsoft.com/54c3832a-4d20-4d6e-81ac-2d6f7bc10bfe

Password Generator Form V2
Update to original password generator form. Uses WPF as opposed to Windows Forms to create the front end UI. Able to generate passwords and allows for either printing of the form or just display the password.
http://gallery.technet.microsoft.com/6ff215d7-ad5a-4fe2-8b61-42bb8ab6b8e0

PowerShell - Organize Windows 7 computers into OUs by IP - 2008R2 only
In my organization I have chosen to organize my Active Directory OU structure based on physicallocations. To tackle this issue, I’ve created a PowerShell script that will run as a batch process and will move the Computer objects into OUs based on their IP address.
http://gallery.technet.microsoft.com/PowerShell-Organize-d37c2a29

PowerShell - Organize Windows 7 computers into OUs by IP - AD 2003/2008/2008R2

http://gallery.technet.microsoft.com/PowerShell-Organize-23c6be16

PowerShell Active Directory Schema Update Report
This script is for all of the IT Pros who have inherited an Active Directory environment which they did not build. This script documents the history of schema updates. Now you can finally get some insight on the origins of your directory.
http://gallery.technet.microsoft.com/PowerShell-Active-4ffedca4

Powershell ADSI Unwrapper
The following script will retrieve all of the properties of the Active Directory objects returned by a query.  These properties are stored in custom objects, and each object is added to an array.This script can be used to retrieve Computer and/or User objects. 
http://gallery.technet.microsoft.com/Powershell-ADSI-Unwrapper-9f14dac2

PowerShell Module for Working With AD SID History
The functions provided in this module will give you added visibility into the status of your SID history throughout the migration process and an easy way to target removal in the final phase.
http://gallery.technet.microsoft.com/PowerShell-Module-for-08769c67

PowerShell script to check group membership
PowerShell script that uses tokenGroups attribute to check membership in security groups
http://gallery.technet.microsoft.com/5adf9ad0-1abf-4557-85cd-657da1cc7df4

Powershell script to handle base64 encoded values in the LDF file
 This script should be used for ldf files used in export/import process of migrating AD objects (for example Users) from one domain to another.During this process are distinguished names containing offending characters encoded to base64. So you cannot edit the ldf file (to change
http://gallery.technet.microsoft.com/Powershell-script-to-33887eb2

Prepopulate a batch of user passwords to RODC (PowerShell)
This Windows PowerShell script will prepopulate a batch of user passwords to a specified Read-only Domain Controller. It will leverage the capability of the native command, repadmin. The script will also strictly check the parameters for avoiding any potential human error.
http://gallery.technet.microsoft.com/Prepopulate-a-batch-of-34e6d0dc

Profile Function - New User in A/D, Exchange, OCS, Home Folder
Add this into your Profile, create new users in A/D by typing newuser firstname lastname
http://gallery.technet.microsoft.com/b9f843fd-248f-4deb-a686-8c9b7513e8c0

PS- Query Active Directory and Return Path to object
This script queries Active Directory and returns the adsPath to objects that it matches. You could then use the adsPath that is returned to connect to that object and set or retieve additional values.
http://gallery.technet.microsoft.com/d8d80b45-8a92-46bc-af80-7408c65c87f9

Querry AD and write data back to User account

http://gallery.technet.microsoft.com/ef2c6180-e653-4824-a532-fbcdc0258bac

Query time server of multiple computers
You can use this script to determine the NTP time source for multiple computers.  It includes the -Computername parameter, which accepts pipeline input and can be used with Active Directory queries to query a large number of computers.ExamplesGet-NTPSourceName            NTPSourc
http://gallery.technet.microsoft.com/Determine-a-computers-time-4b3063e2

Remove disabled users from security groups

http://gallery.technet.microsoft.com/37d6c3e0-1c5f-4cff-a62f-3979fd4cc502

Replace DNS Entry in Domain Computers after DC change

http://gallery.technet.microsoft.com/Replace-DNS-Entry-in-6616840c

Reset password in Untrusted Domain or ANY Domain
Uses Quest Active Roles. Simple example script to show how to connect to ANY domain and reset a user password. Good for field techs on multiple domains
http://gallery.technet.microsoft.com/5b3792b8-a84a-43e9-a335-169cd5990126

Retrieve the Active Directory Default Naming Context For the Logged-On User

http://gallery.technet.microsoft.com/055b9349-19b9-469f-98e4-5a336100d08c

Retrieve the ADsPath for the Logged-On User

http://gallery.technet.microsoft.com/8e09ef22-e0d2-4522-ad7a-43dc85611cd7

Retrieve the DNS Host Name for the Local Computer

http://gallery.technet.microsoft.com/cff74846-95b7-48f8-bba7-387cba5e07aa

Retrieve the Domain Name for the Logged-On User

http://gallery.technet.microsoft.com/9cb93a85-8875-4976-88cd-8dbe1181d0d4

Search Active Directory
This script searches user accounts from an input file (input.csv).
http://gallery.technet.microsoft.com/ce483dbb-5d8e-4abc-86f3-e0a33bc4657e

Search Active Directory - Get User Information
This PowerShell Script can be used to search Active Directory using an input file.
http://gallery.technet.microsoft.com/dd152aa5-bc94-4ac8-9eeb-3bc5b98d425a

Search Active Directory and Get Computer Object Information

http://gallery.technet.microsoft.com/5c618613-9a51-402c-a4b9-edccd06ba8d9

Search AD Users and Computes
This script can be used to generate a list of Active Directory users and computes.
http://gallery.technet.microsoft.com/c2322271-a27d-40f1-99fd-cb4fd116f64b

Search AD using Email Address and Update Employee ID
Search AD using email address from an input file and update the Employee ID filed.
http://gallery.technet.microsoft.com/87a2a2f3-f590-4bdf-911b-da4df53f1f11

Search AD, Collect Local Admin Group Info and Generate Email Alert - PowerShell

http://gallery.technet.microsoft.com/Search-AD-Collect-Local-9952be71

Search for a Computer by Name
Sample script that searches Active Directory for a computer named atl-ws-01. The Name attribute is replicated to the Global Catalog. This means you can connect to a Global Catalog
http://gallery.technet.microsoft.com/ee0089ce-d32f-4280-89a1-c30f04636ec3

Search for a Computer with a Specified Description
Sample script that searches Active Directory for a computer with the description Accounting server. The description attribute is replicated to the Global Catalog. This means you c
http://gallery.technet.microsoft.com/baed1461-501d-4b24-a265-b90deee31284

Search for a Group with a Specified Description
Sample script that searches Active Directory for a group with the description Accounting Group. The description attribute is replicated to the Global Catalog. This means you can c
http://gallery.technet.microsoft.com/a00a72b6-e887-4244-a7f5-ee557e546ce1

Search for a Printer with a Specified Name
Sample script that searches Active Directory for a printer with the name Accounting LaserJet. The Name attribute is replicated to the Global Catalog. This means you can connect to
http://gallery.technet.microsoft.com/db2745c8-a51f-4673-bb02-5e87b28469ea

Search for a Published Folder by Name
Sample script that searches Active Directory for a published folder named Accounting Share. The Name attribute is replicated to the Global Catalog. This means you can connect to a
http://gallery.technet.microsoft.com/be8538c0-d109-415f-9826-9bb44a3821ee

Search for a User with a Specified Cell Phone Number
Sample script that searches Active Directory for a user with the cell phone number +1 (425) 55500924. The mobile phone attribute is replicated to the Global Catalog. This means yo
http://gallery.technet.microsoft.com/242c31fc-1395-437c-8094-4beb00d97830

Search for a User with a Specified Email Address
Sample script that searches Active Directory for a user with the email address kenmyer@fabrikam.com. The mail attribute is replicated to the Global Catalog. This means you can con
http://gallery.technet.microsoft.com/796db25f-7a6b-47e5-82ae-8788a81d8998

Search for a User with a Specified Employee ID
Sample script that searches Active Directory for a user with the Employee ID 12345. The employeeID attribute is not replicated to the Global Catalog; you cannot connect to a Globa
http://gallery.technet.microsoft.com/be7b25a2-bf43-4ace-abce-aed6ecf2fd55

Search for a User with a Specified First Name and Last Name
Sample script that searches Active Directory for a user with the first name Ken and the last name Myer. Both the givenName and sn attributes are replicated to the Global Catalog.
http://gallery.technet.microsoft.com/89f06127-d4b4-47e9-8759-5af5664516a8

Search for a User with a Specified Home Phone Number
Sample script that searches Active Directory for a user with the home phone number +1 (425) 55500924. The home phone attribute is replicated to the Global Catalog. This means you
http://gallery.technet.microsoft.com/96d627ba-92c9-472e-91d4-92984f2be5b6

Search for a User with a Specified Microsoft Exchange Email Address
Sample script that searches Active Directory for a user with the Exchange email alias of kenmyer. The mailNickname attribute is replicated to the Global Catalog, meaning you can c
http://gallery.technet.microsoft.com/c1e7d321-86b7-40ab-b20f-874c58b574f6

Search for a User with a Specified Pager Number
Sample script that searches Active Directory for a user with the pager number +1 (425) 55500924. The pager attribute is not replicated to the Global Catalog, meaning you cannot co
http://gallery.technet.microsoft.com/10d8e2dd-af0d-4187-84c7-6f5053acb6f4

Search for a User with a Specified SAMAccountName
Sample script that searches Active Directory for a user with the sAMAccountName kenmyer. The sAMAccountName attribute is replicated to the Global Catalog. This means you can conne
http://gallery.technet.microsoft.com/4398ce37-67ac-4074-97f1-66db51ff0308

Search for a User with a Specified UPN
Sample script that searches Active Directory for a user with the UPN kenmyer@fabrikam.com. The userPrincipalName attribute is replicated to the Global Catalog. This means you can
http://gallery.technet.microsoft.com/de2cb677-f930-40a5-867d-ea0326ccbcdb

Search for a User with a Specified Work Phone Number
Sample script that searches Active Directory for a user with the phone number +1 (425) 55500924. The telephoneNumber attribute is replicated to the Global Catalog. This means you
http://gallery.technet.microsoft.com/2eeb69b6-722a-41dc-a8e9-55520691cb0d

Search for All Color Printers
Sample script that searches Active Directory for all printers capable of printing in color. The printColor attribute is replicated to the Global Catalog. This means you can connec
http://gallery.technet.microsoft.com/1a905b78-71ea-4e99-8547-af9e191d115e

Search for All Computers by the Date Their Account was Created
Sample script that searches Active Directory for all computer accounts created on or before October 1, 2007. The whenCreated attribute is replicated to the Global Catalog. This me
http://gallery.technet.microsoft.com/9f83d24b-d64a-43a3-92fe-2e3d6a83ff5a

Search for All Computers by the Date Their Account was Last Modified
Sample script that searches Active Directory for all computer accounts modified on or before October 1, 2007. The whenChanged attribute is replicated to the Global Catalog. This m
http://gallery.technet.microsoft.com/20ab1d13-65a2-4547-bfe8-895a94c5989d

Search for All Computers by the Number of Times They Have Logged On
Sample script that searches Active Directory for all computers that have logged on to a domain controller at least once. The logonCount attribute is not replicated to the Global C
http://gallery.technet.microsoft.com/9969167f-9d9b-4c91-aec5-3c6624faba46

Search for All Computers in a Specified Location
Sample script that searches Active Directory for all computers found in Building 45/1675. The location attribute is replicated to the Global Catalog. This means you can connect to
http://gallery.technet.microsoft.com/9b896a6b-cb27-440a-99b8-af75c4411b7c

Search for All Computers Managed by a Specified User
Sample script that searches Active Directory for all computers with Ken Myer as a manager. The managedBy attribute is not replicated to the Global Catalog, meaning you cannot conn
http://gallery.technet.microsoft.com/41cd5a8a-194e-4236-9b02-9b1dd0261948

Search for All Computers Whose Accounts Have Been Disabled
Sample script that searches Active Directory for all disabled computer accounts. The userAccountControl attribute is replicated to the Global Catalog. This means you can connect t
http://gallery.technet.microsoft.com/3dc4df22-97d6-418c-946e-5926cb441633

Search for All Computers with a Specified Operating System
Sample script that searches Active Directory for all computers running Windows XP. The operatingSystemVersion attribute is not replicated to the Global Catalog, meaning you cannot
http://gallery.technet.microsoft.com/68d2f523-4757-4dba-8cfb-486d26211129

Search for All Computers with a Specified Service Pack
Sample script that searches for all computers running Service Pack 2 (for an undefined operating system). The operatingSystemServicePack attribute is not replicated to the Global
http://gallery.technet.microsoft.com/062e2a76-7607-4e29-b8d4-d03cd988ef22

Search for All Contacts by the Date Their Account was Created
Sample script that searches Active Directory for all the contacts created on October 1, 2007 or later. The contact objectCategory is replicated to the Global Catalog. This means y
http://gallery.technet.microsoft.com/18780917-43f8-45cf-9bf3-4da48189afc6

Search for All Contacts by the Date Their Account was Last Modified
Sample script that searches Active Directory for all the contact accounts on October 1, 2007 or later. The whenChanged attribute is replicated to the Global Catalog. This means yo
http://gallery.technet.microsoft.com/5919676a-4d2f-46f3-a3f0-4bc91f3f4e0c

Search for All Contacts from a Specified Country
Sample script that searches Active Directory for all contacts from Spain. The c attribute is replicated to the Global Catalog. This means you can connect to a Global Catalog serve
http://gallery.technet.microsoft.com/27156049-6b11-40b8-aa3f-49f70dd6cdc1

Search for All Contacts Who are Members of a Specified Company
Sample script that searches Active Directory for all contacts from the Contoso company. The company attribute is not replicated to the Global Catalog, meaning you cannot connect t
http://gallery.technet.microsoft.com/9ceb4ead-d557-4276-8962-f691e1654c42

Search for All Domain Controllers in a Domain
Sample script that searches Active Directory for all the domain controllers in a domain.
http://gallery.technet.microsoft.com/236116d8-97bc-48f3-a2fb-f52781ff6e48

Search for All Domains in a Forest
Sample script that searches Active Directory for all the domains in a forest.
http://gallery.technet.microsoft.com/91e729bc-8ab7-4f98-8eeb-325247cbb3dd

Search for All Groups by the Date Their Account was Created
Sample script that searches Active Directory for all the group accounts created on October 1, 2007 or later. The whenCreated attribute is replicated to the Global Catalog. This me
http://gallery.technet.microsoft.com/fece247c-2cd3-44a1-9311-cdd4ac8ec369

Search for All Groups by the Date Their Account was Last Modified
Sample script that searches Active Directory for all the group accounts modified on October 1, 2007 or later. The whenChanged attribute is replicated to the Global Catalog. This m
http://gallery.technet.microsoft.com/0542ab8d-7177-4200-9b31-baf7099bbcda

Search for All Groups with a Specified Manager
Sample script that searches Active Directory for all groups managed by Ken Myer. The managedBy attribute is replicated to the Global Catalog. This means you can connect to a Globa
http://gallery.technet.microsoft.com/b28c8d0b-933c-49a4-8df2-0716669edc2c

Search for All inetOrgPersons by the Date Their Account was Created
Sample script that search Active Directory for all inetOrgPerson accounts created on October 1, 2007 or later. The whenCreated attribute is replicated to the Global Catalog. This
http://gallery.technet.microsoft.com/4059a704-bb95-4556-a14a-befd775e0929

Search for All inetOrgPersons by the Date Their Account was Last Modified
Sample script that search Active Directory for all inetOrgPerson accounts modified on October 1, 2007 or later. The whenChanged attribute is replicated to the Global Catalog. This
http://gallery.technet.microsoft.com/64caf463-63c3-4318-b847-74b6cc42844a

Search for All OUs in a Domain
Sample script that searches Active Directory for all the OUs in a domain. The organizationalUnit objectCategory is replicated to the Global Catalog. This means you can connect to
http://gallery.technet.microsoft.com/b311a9e2-58aa-4a9b-bea3-277e350db733

Search for All Printers by the Date Their Account was Created
Sample script that searches Active Directory for all printer accounts created on October 1, 2007 or later. The whenCreated attribute is replicated to the Global Catalog. This mean
http://gallery.technet.microsoft.com/32c9594f-4b40-4af7-b5c9-8f12fcc67ae8

Search for All Printers by the Date Their Account was Last Modified
Sample script that searches Active Directory for all printer accounts modified on October 1, 2007 or later. The whenChanged attribute is replicated to the Global Catalog. This mea
http://gallery.technet.microsoft.com/affcfcef-f481-402c-8715-33f73510c91d

Search for All Printers Capable of Double Sided Printing
Sample script that searches Active Directory for all printers capable of double-sided printing. The printDuplexSupported attribute is replicated to the Global Catalog. This means
http://gallery.technet.microsoft.com/4f5583cc-bfa7-4a17-91de-661e184d80b2

Search for All Printers of a Specified Model
Sample script that searches Active Directory for all the HP LaserJet M4345 MFP PCL 6 printers. The driverName attribute is replicated to the Global Catalog. This means you can con
http://gallery.technet.microsoft.com/eb02f305-e218-4fff-bb7d-4967afc009d3

Search for All Printers that Support Collating
Sample script that searches Active Directory for all the printers that support collating. The printCollate attribute is not replicated to the Global Catalog, meaning you cannot co
http://gallery.technet.microsoft.com/9be74c4e-7ade-44b3-a537-0c96b28399ea

Search for All Printers that Support Stapling
Sample script that searches Active Directory for all the printers that support stapling. The printStaplingSupported attribute is replicated to the Global Catalog. This means you c
http://gallery.technet.microsoft.com/ff820d6f-39c8-4efd-b9c2-fc12af96acdd

Search for All Printers with a Specified Amount of Installed Memory
Sample script that searches Active Directory for all the printers with more than 32 megabytes of installed memory. The printMemory attribute is not replicated to the Global Catalo
http://gallery.technet.microsoft.com/428cfb3c-bcef-47f1-813f-81e8aa550e92

Search for All Printers with a Specified Maximum Resolution
Sample script that searches Active Directory for all printers with a maximum print resolution greater than or equal to 600 dpi. The printMaxResolutionSupported attribute is replic
http://gallery.technet.microsoft.com/5700e66d-93f1-4a8c-8489-95f5b1343ff9

Search for All Printers with a Specified Print Server
Sample script that searches Active Directory for all the printers connected to the print server atl-ps-01.fabrikam.com. The serverName attribute is replicated to the Global Catalo
http://gallery.technet.microsoft.com/99077ca4-64fa-4dda-b862-a4cdb9adb67f

Search for All Published Folders by a Specified Keyword
Sample script that searches Active Directory for all publisher folders with the keyword finance. The keywords attribute is replicated to the Global Catalog. This means you can con
http://gallery.technet.microsoft.com/51fb7d7c-446f-46e7-bf8b-0f47b9f13ac5

Search for All Published Folders in a Domain
Sample script that searches Active Directory for all the folders published in a domain. The volume objectCategory is replicated to the Global Catalog. This means you can connect t
http://gallery.technet.microsoft.com/ad937d51-2fb7-490d-a9b3-980903ab0f0e

Search For All Sites in a Forest
Sample script that searches Active Directory for all the sites in a forest.
http://gallery.technet.microsoft.com/f3f91ce0-a129-4bee-9ace-b5e9e41b8528

Search for All the Attributes That Appear in the Global Catalog
Sample script that searches Active Directory for all the attributes that are replicated to the global catalog.
http://gallery.technet.microsoft.com/1d6bf801-1e46-42ce-af90-90dae16039e6

Search for All the Computers in a Domain
Sample script that searches Active Directory for all the computers in a domain. The computer objectCategory is replicated to the Global Catalog. This means you can connect to a Gl
http://gallery.technet.microsoft.com/9a98661d-2816-42df-bcbd-45e08af6730f

Search for All the Contacts in a Domain
Sample script that searches Active Directory for all the contacts in a domain. The contact objectCategory is replicated to the Global Catalog. This means you can connect to a Glob
http://gallery.technet.microsoft.com/035048d9-569a-4700-ae43-df5613eeb407

Search For All the Discoverable Domain Controllers in a Domain
Sample script that searches Active Directory for all the discoverable domain controllers in a domain.
http://gallery.technet.microsoft.com/9cf0735a-f0e2-4eec-9501-594ecb50ad0f

Search for All the Domain Local Distribution Groups in a Domain
Sample script that searches Active Directory for all the local distribution groups in a domain. The groupType attribute is replicated to the Global Catalog. This means you can con
http://gallery.technet.microsoft.com/920d2f43-933b-4dae-b334-6dc801748713

Search for All the Domain Local Security Groups in a Domain
Sample script that searches Active Directory for all the local security groups in a domain. The groupType attribute is replicated to the Global Catalog. This means you can connect
http://gallery.technet.microsoft.com/7d0e9aa5-eb46-47c2-a2f1-e05b5eaab9bf

Search For All the Global Catalog Servers in a Forest
Sample script that searches Active Directory for all the global catalog servers in a forest.
http://gallery.technet.microsoft.com/1ab9c567-0af8-40b3-af81-ad0b0f2861e4

Search for All the Global Distribution Groups in a Domain
Sample script that searches Active Directory for all the global distribution groups in a domain. The groupType attribute is replicated to the Global Catalog. This means you can c
http://gallery.technet.microsoft.com/4ec4d545-2416-4e7f-bffb-b9bf309282e0

Search for All the Global Security Groups in a Domain
Sample script that searches Active Directory for all the global security groups in a domain. The groupType attribute is replicated to the Global Catalog. This means you can connec
http://gallery.technet.microsoft.com/c4e5139a-7e42-4b9e-81a3-31df7458286e

Search for All the Groups in a Domain
Sample script that searches Active Directory for all the groups in a domain. The group objectCategory is replicated to the Global Catalog. This means you can connect to a Global C
http://gallery.technet.microsoft.com/a88c3b17-4d9c-48c5-b655-4297dbd6287b

Search for All the Groups Whose Name Starts With a Specific Set of Characters
Sample script that searches Active Directory for all the groups that have a name beginning with the characters G-S-Group. The name attribute is replicated to the Global Catalog. T
http://gallery.technet.microsoft.com/fbbefa16-7146-44e5-924e-93b4c9c8822e

Search for All the inetOrgPersons in a Domain
Sample script that searches Active Directory for all the inetOrgPerson accounts in a domain. The inetOrgPerson objectClass is replicated to the Global Catalog. This means you can
http://gallery.technet.microsoft.com/6fe1ac55-c7f7-4675-83b2-4b5b39bf679d

Search For All the Objects Created After a Specified Date
Sample script that searches Active Directory for all the objects in a domain that were created on October 1, 2007 or later.
http://gallery.technet.microsoft.com/376cdcb9-9689-4780-8a1e-16a119922108

Search For All the Objects in a Domain
Sample script that searches Active Directory for all the objects in a domain.
http://gallery.technet.microsoft.com/a6248f46-ee44-41f1-81f5-58db1e4d357d

Search for all the OUs with a Specific Word in Their Names
Sample script that searches Active Directory for all the OUs that have the word Server in their name. The Name attribute is replicated to the Global Catalog. This means you can co
http://gallery.technet.microsoft.com/1155ecd7-3eab-409b-82b3-9651e640224f

Search for All the Printers Published in a Domain
Sample script that searches Active Directory for all the printers published in a domain. The printQueue attribute is replicated to the Global Catalog. This means you can connect t
http://gallery.technet.microsoft.com/d1786881-3af8-4b09-b02f-ed8a6bef6250

Search for All the Site Links in a Domain
Sample script that searches Active Directory for all the site links in a domain.
http://gallery.technet.microsoft.com/84874175-ac4b-4e10-8776-6a728c0bf00b

Search for All the Sites in a Domain
Sample script that searches Active Directory for all the sites in a domain.
http://gallery.technet.microsoft.com/a7e49d1f-e416-47ae-bf7b-5283d06ea3ae

Search for All the Subnets in a Domain
Sample script that searches Active Directory for all the subnets in a domain.
http://gallery.technet.microsoft.com/fd108710-a9ae-407a-b1c1-9d692a541b12

Search For All the Trust Relationships in a Domain
Sample script that searches Active Directory for all the trust relationships in a domain.
http://gallery.technet.microsoft.com/aba6297b-d2b5-4dc0-a17c-faf7423b4411

Search For All the Trust Relationships in a Forest
Sample script that searches Active Directory for all the trust relationships in a forest.
http://gallery.technet.microsoft.com/90b135cf-f74e-4ec3-adde-c2813ddead9d

Search for All the Universal Distribution Groups in a Domain
Sample script that searches Active Directory for all the universal distribution groups in a domain. The groupType attribute is replicated to the Global Catalog. This means you can
http://gallery.technet.microsoft.com/86a8c273-27ba-4adc-84d6-699167ffdc4c

Search for All the Universal Security Groups in a Domain
Sample script that searches Active Directory for all the universal security groups in a domain. The groupType attribute is replicated to the Global Catalog. This means you can con
http://gallery.technet.microsoft.com/fe6a3940-6dae-4db1-b6dc-3b9d17f25a19

Search for All the Users in a Specified OU
Sample script that searches Active Directory for all the users in the Finance OU.
http://gallery.technet.microsoft.com/674db4f0-a7c7-4765-9448-db7d4d543df5

Search for All the Users in a Specified OU and Any Sub OUs
Sample scripot that searches Active Directory for all the users in the Finance OU and any child Ous..
http://gallery.technet.microsoft.com/dfc8fc4d-75df-41eb-851a-4495e4f751df

Search for All Users Assigned a Specific Logon Script
Sample script that searches Active Directory for all the users who have the logon script UserLogon.vbs. The scriptPath attribute is not replicated to the Global Catalog; you cann
http://gallery.technet.microsoft.com/6fbb6887-082f-45dc-8f52-4cc2a6141d5c

Search for All Users by Allowed Workstation
Sample script that searches Active Directory for all the users allowed to log on to the computer atl-ws-01. The userWorkstations attribute is not replicated to the Global Catalog;
http://gallery.technet.microsoft.com/5fef7889-6d22-42f2-8c59-20781091dbeb

Search for All Users by Favorite Drink
Sample script that searches Active Directory for all the users who selected tea as their favorite drink. The drink attribute is not replicated to the Global Catalog; you cannot c
http://gallery.technet.microsoft.com/37f76a1e-6be7-454c-882c-613bb25ca263

Search for All Users by Fax Number
Sample script that searches Active Directory for all the users with the fax number +1 (425) 55500924. The facsimileTelephoneNumber attribute is not replicated to the Global Catalo
http://gallery.technet.microsoft.com/93adc954-41b4-439a-9301-710aa9aeb18b

Search for All Users by the Date Their Account was Created
Sample script that searches Active Directory for all user accounts created on October 1, 2007 or later. The whenCreated attribute is replicated to the Global Catalog. This means y
http://gallery.technet.microsoft.com/05ab697a-a1fe-4425-8e4b-081b3824987f

Search for All Users by the Date Their Account was Last Modified
Sample script that searches Active Directory for all user accounts modified on October 1, 2007 or later. The whenChanged attribute is replicated to the Global Catalog. This means
http://gallery.technet.microsoft.com/0cddf2ce-c371-4cc0-9c57-e118c1ec207c

Search for All Users Having a Specified Exchange Server
Sample script that searches Active Directory for all the users that have the Exchange server o=fabrikam/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=atl-msg-01. Th
http://gallery.technet.microsoft.com/eea86718-c06a-49d4-814f-6d37ec68da6c

Search for All Users in a Department
Sample script that searches Active Directory for all the users in the Finance department. The Department attribute is not replicated to the Global Catalog; you cannot connect to a
http://gallery.technet.microsoft.com/b88344c0-0d0d-4cee-9a70-c2411603f76e

Search for All Users in a Domain
Sample script that searches Active Directory for all the users in a domain. The user objectCategory is replicated to the Global Catalog. This means you can connect to a Global Cat
http://gallery.technet.microsoft.com/1812229c-37de-4798-b6d8-4064f60868db

Search for All Users in a Specified Company
Sample script that searches Active Directory for all the users in a domain from the Contoso company. The company attribute is not replicated to the Global Catalog; you cannot conn
http://gallery.technet.microsoft.com/1bf0a63c-894d-4191-bd9e-57547775472e

Search for All Users in a Specified Office Location
Sample script that searches Active Directory for all the users in Building 45/1675. The physicalDeliveryOfficeName attribute is not replicated to the Global Catalog; you cannot co
http://gallery.technet.microsoft.com/6b74a926-9290-444b-a243-d7579e7690da

Search for All Users Who Have a Home Directory
Sample script that searches Active Directory for all the users who have a home directory. The homeDirectory attribute is not replicated to the Global Catalog; you cannot connect t
http://gallery.technet.microsoft.com/d6e95833-b751-4832-8e58-e4b1f6dbbdb0

Search for All Users Who Have a Telephone
Sample script that searches Active Directory for all the users who have a work phone number. The telephoneNumber attribute is replicated to the Global Catalog. This means you can
http://gallery.technet.microsoft.com/0f586b63-a83f-4d1e-a15c-4b479c364c89

Search for All Users Who Have a Voice Over IP Phone
Sample script that searches Active Directory for all the users who have an IP phone number. The ipPhone attribute is replicated to the Global Catalog. This means you can connect t
http://gallery.technet.microsoft.com/c769d03a-afa5-401a-984e-75fdbf3e59de

Search For All Users Who Have an Alternate Recipient
Sample script that searches Active Directory for all the users in a domain who have an alternate recipient.
http://gallery.technet.microsoft.com/9d3ee866-d77f-4d36-948d-58fe0a53d15e

Search for All Users Who Have Logged On at Least Once
Sample script that searches Active Directory for all the users who gave logged on to a domain controller at least once. The logonCount attribute is not replicated to the Global Ca
http://gallery.technet.microsoft.com/4670d78f-627a-4cbb-bbce-fdaacf21b076

Search for All Users Who Have Remote Access Dial In Permissions
Sample script that searches Active Directory for all the users who have remote access dial-in permissions. The msNPAllowDialin attribute is not replicated to the Global Catalog; y
http://gallery.technet.microsoft.com/08413319-5fa4-4e67-a372-c4dd1d8c1ad3

Search for All Users Who Must Change Their Password On Their Next Logon
Sample script that searches Active Directory for all the users who must change their password on their next logon. The pwdLastSet attribute is not replicated to the Global Catalog
http://gallery.technet.microsoft.com/c2979608-cce3-41e8-8855-38f2aec1dba3

Search for All Users Who Must Log On Using a Smartcard
Sample script that searches Active Directory for all the users who must logon using a smartcard. The userAccountControl attribute is replicated to the Global Catalog. This means y
http://gallery.technet.microsoft.com/f99119b3-5c53-4388-a8e4-e92595d5ae3a

Search for All Users Who Work in a Specified City
Sample script that searches Active directory for all the users who work in the city of Redmond. The l attribute is replicated to the Global Catalog. This means you can connect to
http://gallery.technet.microsoft.com/90ed8981-768c-4910-b735-7f30e5ce028d

Search for All Users Who Work in a Specified Country
Sample script that searches Active directory for all the users who work in the United States. The c attribute is replicated to the Global Catalog. This means you can connect to a
http://gallery.technet.microsoft.com/c8cffcf9-0565-4a1d-8802-6b8e3321621e

Search for All Users Who Work in a Specified State
Sample script that searches Active directory for all the users who work in the state of Washington. The st attribute is replicated to the Global Catalog. This means you can connec
http://gallery.technet.microsoft.com/510861ae-4524-4f24-a048-2745acf0ff8a

Search for All Users Whose Accounts Have Been Disabled
Sample script that searches Active Directory for all disabled user accounts. The userAccountControl attribute is replicated to the Global Catalog. This means you can connect to a
http://gallery.technet.microsoft.com/bb5fa1f0-2028-4085-895d-2dd7d2c4f80d

Search for All Users Whose Passwords Never Expire
Sample script that searches Active Directory for all user account passwords that never expire. The userAccountControl attribute is replicated to the Global Catalog. This means you
http://gallery.technet.microsoft.com/3d8320cb-0c74-400f-9d17-c278615c5c1d

Search for All Users with a Specified Job Title
Sample script that searches Active Directory for all users with the job title Accountant. The Title attribute is not replicated to the Global Catalog, meaning you cannot connect t
http://gallery.technet.microsoft.com/add9556d-61e6-420a-b55f-f415ed52bece

Search for All Users with a Specified Manager
Sample script that searches Active Directory for all users managed by Ken Myer. The manager attribute is replicated to the Global Catalog. This means you can connect to a Global C
http://gallery.technet.microsoft.com/c1ba6490-1494-4006-9f34-ac7d1a7bcbee

Search for All Users with More Than One Failed Logon
Sample script that searches Active Directory for all users who have at least one failed logon. The badPwdCount attribute is not replicated to the Global Catalog; you cannot connec
http://gallery.technet.microsoft.com/85a320af-b51d-4c61-8fad-ba220203a9fe

Search for All Users Within a Specific Area Code
Sample script that searches Active Directory for all users in the 425 area code. The telephoneNumber attribute is replicated to the Global Catalog. This means you can connect to a
http://gallery.technet.microsoft.com/6ac711ae-96e8-438c-9663-7dd89938cfee

Search for All Users Within a Specified Zip Code
Sample script that searches Active Directory for all users with the Zip code 98052. The postalCode attribute is not replicated to the Global Catalog; you cannot connect to a Globa
http://gallery.technet.microsoft.com/8f747692-b33b-42a4-b968-c6c2dcfeaa16

Search for an OU with a Specified Description
Sample script that searches Active Directory for all OUs with the description IT Services. The description attribute is replicated to the Global Catalog. This means you can connec
http://gallery.technet.microsoft.com/61819a0d-076c-4fdf-a54d-016cfab94caf

Search for domain users on folders
This script gets the ACL of a folder and checks active directory if it's a useraccount. If it is a domain user account it will output the path and the username.
http://gallery.technet.microsoft.com/8133b64a-b0aa-4c3f-8f08-427d925d67c9

Search for Printers by Asset Number
Sample script that searches Active Directory for the printer with the asset number 12345. The assetNumber attribute is not replicated to the Global Catalog, meaning you cannot con
http://gallery.technet.microsoft.com/53ca37a1-d4dd-40a4-b474-1492663c63d9

Search for Printers by Location
Sample script that searches Active Directory for all the printers found in Building 1, Floor 1. The location attribute is replicated to the Global Catalog. This means you can conn
http://gallery.technet.microsoft.com/27c3cf50-32ac-4612-a124-e58a6065eb47

Search for Printers by Printing Rate (pages per minute)
Sample script that searches Active Directory for all printers capable of printing more 20 or more pages per minute. The printRate attribute is not replicated to the Global Catalog
http://gallery.technet.microsoft.com/183b2129-01ea-47e1-8fb0-f75d6b3dadc9

Search Users from Multiple Domains Using a Common Attribute
This script searches 2 Active Directory domains using a common matching attribute value (employeeID).
http://gallery.technet.microsoft.com/92128563-2512-4d73-8f07-0bc379230664

Search-ADUserWithExpiringPasswords
Gets Active Directory user accounts with passwords that are expiring in a given time period or by a specified time.
http://gallery.technet.microsoft.com/8b1a5aff-1d95-445b-8b2d-721d0c6c5f03

Set logonHours Attribute of Users
PowerShell script to assign the hours when users are allowed to logon to the domain
http://gallery.technet.microsoft.com/fd6a340b-ed8b-4787-8d12-3c6fcb822104

Set password foreign Domain WITH password confirmation
Connect to any specified DC
http://gallery.technet.microsoft.com/77ba04bb-f9bc-49be-a648-75d8223e673b

Set-AD_thumbnailphoto_From_SQL
Hi,I'm updating my my staff and student AD attribute "thumbnailphoto" from two different sources. This is a sample script of how I do it from on of our SQL servers.you need to make sure you're running the script as an Administrator .. the SQL add-in doesn't seem to work without d
http://gallery.technet.microsoft.com/Set-ADthumbnailphotoFromSQL-5bf0e452

Set-FSMORoleOwner
This advanced function allows you to transfer or seize the FSMO roles to a specified Domain Controller.
http://gallery.technet.microsoft.com/83a93010-b43e-465e-b844-667668b98bbc

sIDHistory Report - Multi Value Support
PowerShell Script can used to search a user object in Active Directory domain and generate a report with their SIDHistory value(s)
http://gallery.technet.microsoft.com/082a257a-5516-4142-bf77-7beb874814da

Stop/Start or Enable/Disable Service - Credential
I have updated the Stop/Start or Enable/Disable Service script with Get-Credential command which will prompt you to enter a user name password rather than using the default logged in credential for the remote connection.
http://gallery.technet.microsoft.com/6414efd1-88df-4c98-a7ba-bb36f259c8ea

Sync computer comments with their description in Active Directory
The script iterates over the computer accounts in the current active directory domain and updates the computer comment with the description in active directory.
http://gallery.technet.microsoft.com/5c5bb1f7-519b-43b3-9d3a-dce8b9390244

Termination Tool

http://gallery.technet.microsoft.com/Termination-Tool-7b3c1543

Translate SID to User Account and User Account to SID
Use WMI to translate a SID to User Account and/or a User Account to SID
http://gallery.technet.microsoft.com/f1c83aed-fe60-48d5-90ab-22388fcbd54f

Update AD Users in Bulk from Excel Spreadsheet
A PowerShell V1 script to update users (or any class of AD objects) in bulk from the information in a Microsoft Excel spreadsheet. Only single-valued string attributes are supported.
http://gallery.technet.microsoft.com/Update-AD-Users-in-Bulk-ca0068f1

Update Employee ID - PowerShell Script
Here is a simple PowerShell script which you can use to update the employee ID from a CSV input file.
http://gallery.technet.microsoft.com/e9bafc1a-b5b1-4663-8e25-b0d0ea28c2b2

Update ManagedBy Attribute
This PowerShell script can be used update ManagedBy attribute.
http://gallery.technet.microsoft.com/e71b81af-dc0e-423e-a931-c66b5e0672bb

Update-AdminPassword

http://gallery.technet.microsoft.com/a179104d-7008-41ab-a758-832ed6af8dc7

Updated List Group Members Script
Generate Group Membership details - This is an update to one of my old scripts - http://gallery.technet.microsoft.com/scriptcenter/dcc9432e-d541-4be2-a39c-637c8d4c9fd0
http://gallery.technet.microsoft.com/a1672a07-76d7-43d2-8c19-43913bd6b7c2

Upload users from csv and set default pasword, group and home drive
Upload users from csv and set default pasword, group and home drive
http://gallery.technet.microsoft.com/cfa1d94a-439e-4268-b6ea-f180b9b027ff

Use ERP export file to modify Active Directory User Account
To update Active Directory user object attributes from information provided by a delimited ERP export file.
http://gallery.technet.microsoft.com/1c2ccd0b-0ed2-4ae2-9841-460fd6d51435

User Profile and Operating System (OS) Info
This script can be used to generate user profile and Operating System (OS) information from an input file (input.csv) which contains computer names.
http://gallery.technet.microsoft.com/5c166012-be14-4b79-b1a8-bd544a342529

UserInfo
In Windows 2003 there was an Additional Account Information add-in to ADUC. I wanted the same type of information so I wrote this script and added a few things. It uses Quest AD Tools and gets basic AD account information on Passwords, Exchange, Communicator and Groups.
http://gallery.technet.microsoft.com/f0288b3a-3d13-4ebf-be16-0491d507eec6

Validate SPN mappings
Script module for validating SPN mappings.
http://gallery.technet.microsoft.com/a3cfe63f-7369-403a-afed-5ce03a3bbb21

Verify admin$ share Access
Here is a PowerShell script which you can use to test the admin$ share access. This script is useful when you are performing computer migrations. You can use a CSV file as an input file.
http://gallery.technet.microsoft.com/b1a4fe06-c947-4b46-ac86-82033b4ec854

Write Active Directory Attributes to a Database
Loads Active Directory computer, group and person attributes into a database. This script requires Powersmo (PowerShell Community Extension 1.1.1) and a SQL Server database with S
http://gallery.technet.microsoft.com/4e09d784-ddcd-45bc-bedb-3df61f899861