blog.powershell.no

On Windows PowerShell and other admin-related topics

Mapping printers based on Active Directory group membership using Windows PowerShell

While researching for a logon script setup for mapping network printers using Windows PowerShell, I thought of using the Windows native tool printui.dll for the actual printer mappings.
However, I was`nt quite sure how to check for a users` group membership in Active Directory. This sure can be accomplished with a tool like Quest`s PowerShell Commands for Active Directory. However, installing this on every domain computer wasn`t an option.
Then I found Andy Grogan`s PowerShell function for determining AD group membership.

Based on this function, and the printui.dll the task was easy to accomplish. I`ve published a sample script to PoshCode.org, available from here.

You may also want to check out “PrintUI.DLL User’s Guide and Reference“.

Tested with Windows PowerShell v 1.0/2.0 and Windows XP/Vista/7.

As an alternative, you may also want to check out this blog post on mapping printers using Group Policy.

Advertisements

November 28, 2009 - Posted by | Deployment, Print management, Scripting, Windows PowerShell

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: