Jump to content
mashti

Some Useful Powershell Sample Scripts

Recommended Posts

List Group Members in Active Directory–PowerShell Script

 

As you can see on the following screenshot, this script uses an input file called Glist.csv which contains all group names.

 

Hidden Content

    Give reaction to this post to see the hidden content.
AD-GroupList.ps1

Hidden Content

    Give reaction to this post to see the hidden content.

  • Like 5
  • Thanks 1

Share this post


Link to post
Share on other sites

Adding and Removing Fonts with Windows PowerShell

 

Add-Font.ps1 can be used to install a single font file or a folder of fonts. Remove-Font.ps1 can be used to uninstall a single font file installed in the \Windows\Fonts folder. These script are written for Windows PowerShell version 2. Run each script with the -help switch for usage details.

 

Add-Font.ps1

 

 

Hidden Content

    Give reaction to this post to see the hidden content.

 

 

 

Remove-Font.ps1

 

 

Hidden Content

    Give reaction to this post to see the hidden content.

 

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

PowerShell Script to Audit Printer Queue Usage

 

To help resolve this, I wrote a PowerShell script that audits the printer queues on a server (locally or remote) and will tell us whether or not a Printer Queue has been used and if so, when it was last used.

 

The script works by first grabbing a list all of the printer queues on a print server. It then goes through all the logs in the print server’s “System” event log and looks specifically for ‘Print’ events.

 

Hi,

 

Thanks for the script. It seems to work, however the dates of last used in the output file is incorrect. My results look like this:

 

#TYPE Queue

"Name","Used","LastUsed"

"TPS - SAVIN 8030E","False","1/1/0001 12:00:00 AM"

"CS - RICOH Aficio MP C5000","False","1/1/0001 12:00:00 AM"

"CNHS - Canon iR5055","False","1/1/0001 12:00:00 AM"

"CAS - SAVIN 8035","False","1/1/0001 12:00:00 AM"

"CALS - RICOH Aficio MP C6000","False","1/1/0001 12:00:00 AM"

"ATHL - SAVIN C3528","False","1/1/0001 12:00:00 AM"

"ATHL - Canon iR2270","False","1/1/0001 12:00:00 AM"

"ASP - SAVIN C2525","False","1/1/0001 12:00:00 AM"

"AFS - RICOH Aficio MP C5000","False","1/1/0001 12:00:00 AM"

"ACSS - Canon iR C2880","False","1/1/0001 12:00:00 AM"

"ACCT - Canon iR C4080","False","1/1/0001 12:00:00 AM"

"_Total","False","1/1/0001 12:00:00 AM"

 

Any idea how I can fix the script to reflect the actual dates and times instead of "1/1/0001 12:00:00 AM"?

Thanks.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...