Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Browsing all 6937 articles
Browse latest View live

Delete disabled AD Accounts that are over 2 years old

Hi Hoping you can help.I have been asked to delete all DISABLED AD accounts where the last logon was over 2 years ago. All our disabled accounts are in 1 OU, so I would like to run the powershell...

View Article


O365 - Set-MailboxSearch (Combining Datatypes?)

Hello all,I am trying to write a script that will automatically add new members to our mailbox search on Office 365.  The problem is I do not want the Set-MailboxSearch cmdlet to overwrite existing...

View Article


PowerShell Command History Lesson Part 1

Recently someone asked me on Twitter about a way to retrieve the command history from another user's PowerShell session. That's a great question and I think I know where the user is coming from but...

View Article

Change physical path credential for IIS website

Hi all,I am quite new to PowerShell scripting. I am trying to update physical path credentials that is being used by website. But I am unable to do so.Can someone help me doing that please?PS: There is...

View Article

Powershell CSV report usernames & Phone Numbers - but exclude area code?

HowdyI am working on a PowerShell report of user names, First, Last, and their phone number populated in AD.But the request is to take out the area code.  That's not something I've done before, can...

View Article


VHD to VHDX Conversion Made Easy with PowerShell

A couple of weeks ago I wrote “3 Easy Steps to Migrate to Hyper-V 2012 R2” talking about how to migrate VM’s from Windows Server 2008 R2 to Windows Server 2012 R2. Since then I keep hearing the same...

View Article

WMI and SCCM - Check How Many Pending Updates for Remote Machines

Hi All,My company uses System Centre 2012 Configuration Manager (SCCM 2012) to deploy Windows operating system updates to servers and workstations.I've written a PowerShell script to reach out to...

View Article

Bulk Set Manager

Hi.I have this powershell script. For some reason it will change all other properties but Manager - and I cannot figure out why - any ideas?My csv contains Manager stated as SamAccountName.mport-Module...

View Article


Require a script to find the computer objects in multiple domain

Hi All, I have around 150 Windows servers to which I need to find out if these exists in AD or not.The problem is I have around 10 domains and I need to find out the servers exist in those 10 domains...

View Article


Issue while executing powershell script

test.ps  contains $letterArray = "a","b","c","d"          foreach ($letter in $letterArray)          {              Write-Host $letter...

View Article

#PSTip Explore TechEd NA 2014 sessions with PowerShell

TechEd North America 2014 has a nice Content Catalog page. It provides a few useful search criteria to filter the content and find the sessions you are mostly interested in. That’s great, but I wanted...

View Article

PowerShell –EncodedCommand and Round-Trips

PowerShell.exe accepts the –EncodedCommand parameter, which is a way to ‘wrap’ DOS-unfriendly command strings in such a way as to be safely passed into PSH for execution.  It’s a great feature....

View Article

Recursing through long list of shares with get-acl

 Hi folks. First post here.  I'm working on an inventory script based that gets a number of items from a given remote server, including the File Shares and their Permissions using wmi calls.The script...

View Article


Read specific lines from a text file

I have a following text fileTom arrived at 11.30.14 01/03/07Rob arrived at 11.33.45 01/03/07Joy arrived at 11.23.30 01/03/07Sue arrived at 11.23.44 01/03/07Liv arrived at 11.51.30 01/03/07Rik arrived...

View Article

PowerShell for N00bs: Libraries, Paths, and Y

One of the scripts a coworker inherited has the following workflow:Read More

View Article


Get ready for Windows Server 2012 and Powershell 4.0

Have you made any advancements toward moving to Windows Server 2012 and Powershell 4.0? If not, I have a shortcut for you: CBT Nuggets classes taught by Don Jones.Read More

View Article

Testing your PowerShell scripts with Pester: Assertions and more

This is part two of Pester series of articles. In this article you will learn about the Context keyword, how to use all the assertions available in Pester and a bit about best practices.Read More

View Article


Get started with Pester (PowerShell unit testing framework)

Some time ago I stumbled upon the Pester framework that promised I would be able to test my scripts. This seemed to be super-useful for my day-to-day scripting, but unfortunately the learning curve was...

View Article

Exchange 2003 and Powershell v1 help

Hi All,Heres the situation:Exchange 2003, PowerShell v1I'm looking to get the following information -- UserName, Mailbox Size, Last logon date and time and if I can get the last logon time filtered to...

View Article

Removing Computers from SCCM Collection

Below is a simple little script that removes a computer from SCCM collection. The script works fine removing one computer at a time. I would like to have the option of removing one or multiple...

View Article
Browsing all 6937 articles
Browse latest View live