Showing tag results for PowerTip

Dec 23, 2016
Post comments count0
Post likes count0

PowerTip: Use PowerShell to determine active CIM sessions

Doctor Scripto

Summary: Use the Common Information Model (CIM) cmdlets to pull a list of active sessions to remote workstations. How can I find active CIM sessions on my workstation? Just use this one cmdlet to list all active CIM sessions, and you’re done for the day!

Windows PowerShellPowerTipguest blogger
Dec 22, 2016
Post comments count0
Post likes count0

PowerTip: List locked-out accounts in Active Directory with PowerShell

Doctor Scripto

Summary: Use Active Directory cmdlets to identify locked-out user accounts and computer accounts. Is there a quick and easy way to find all users who are locked out in Active Directory by using PowerShell?   You’ll love this. The answer is just one cmdlet away with the ActiveDirectory module. Just use Search-ADAccount, and you’ll have a co...

Windows PowerShellPowerTipguest blogger
Dec 21, 2016
Post comments count0
Post likes count1

PowerTip: Limit Get-Childitem to a limited depth in the tree

Doctor Scripto

Summary: Use the new -depth parameter to control how far down a directory you can search. I have a large file structure to search but I only want to go two folders deep on the search.  Is there a way to do this in PowerShell? Certainly!  In PowerShell 5.0, you can use the -depth parameter to specify how many branches deep you’d like to limit fro...

Windows PowerShellPowerTipguest blogger
Nov 25, 2016
Post comments count0
Post likes count0

PowerTip: Capture the output of a Linux application in PowerShell

Doctor Scripto

Summary: Use the built-in features of PowerShell to obtain data produced by a Linux application. Can I run a Linux application like ls and capture its output in PowerShell? You certainly can!  It’s no different from when you normally grab output from any other command in Windows.   To grab the output of the ls command, for example, just assign i...

Windows PowerShellPowerTipguest blogger
Nov 18, 2016
Post comments count0
Post likes count0

PowerTip: Return a status code to Linux from PowerShell

Doctor Scripto

Summary: Pass a result code back to a calling Linux environment from Open Source PowerShell. How can I pass a numeric value back to a calling Bash Shell to indicate an error? Just simply supply the EXIT command and a numeric value at the point where the error is flagged. For example, the following code is a PowerShell script that returns a value...

Windows PowerShellPowerTipguest blogger