February 6th - Doug Finke on the PowerShell parser and AST
PowerShell Abstract Syntax Tree (AST) Writing PowerShell scripts are powerful and productive. Building tools for PowerShell to extract and manipulate the script itself can make you more productive. In...
View Articleconvert Text to objects
My PowerShell skills are very limited and I was hoping to get some help. I need to convert output text from a legacy CLI tool into objects so that I can better utilize Powershell's capabilities. The...
View ArticleInvoke-Expression? Sort? Building a script for MDT application replacement...
Hi. I did some searching through the forums. I've been working on this for 3 days. I'm somewhat of a noob to powershell. The script is to run as an MDT task and reads a file(List of old programs.txt)...
View ArticleFrom One-Liner to ForEach One-Liner
In "Where-Object and the Pipeline" and "Introducing the Pipeline and ForEach," I talked about the two essential building blocks for one-liners: the pipeline and ForEach. This month, I want to show you...
View ArticleWhere-Object and the Pipeline
In "PowerShell Cmdlets for DNS," I promised I'd cover ForEach-Object, an essential PowerShell power tool. But that's a big topic, so this month I want to warm up to ForEach by looking at the Powershell...
View ArticlePowerShell Cmdlets for DNS
If you perform DNS administration on Windows Server systems, you might remember the columns I wrote years ago—such as "Scripting DNS Setup"—about Dnscmd, a powerful command-line tool that lets you do...
View ArticleUsing Quest Powershell to check if users are members of certain groups.
Hi, Im having issues with a script I have written. It dont work and returns nothing. Basically I have a list of users that i am checking to see if they have 2 ad groups. if they have then its recorded...
View ArticleUse Get-WmiObject to enable Network Interface Card Power Management settings
Hi Everyone,I have a vbscript that changes power management settings for the Network Card: this works for both local and remote computers.I have rewritten this as a powershell script: this works when...
View ArticleWhat am I doing wrong?
I have created this migration script for a Win7 deployment. It takes a parameter "-site" and then does a few things on the way to creating folders. It doesnt seem to like the paramter input. Also, i...
View ArticleGet-Childitem -exclude
Altough a very basic problem, this still seems beyond me:Get-ChildItem -Force -path d:\Directory: D:\Mode LastWriteTime Length Name---- ------------- ------...
View ArticleAdding AD Global groups to Domain Local via PS script.
Hi everyone.I have already posted a task here about cloning all AD global groups to AD Domain Local groups, and some members here have helped me correct my script so now it runs normally. Now I need to...
View ArticleLogical Constructs Question
I am not a programmer at all, but I do want to be able to write my own scripts to make my admin life a bit easier. So, I am now into chapter 3 of Mr. Jones's TollMaker book. I have always had issues...
View Article[help] compare in ps
Compare-Object $(Get-Content C:\Users\Desktop\Deployment\a.txt) $(Get-Content C:\Users\Desktop\Deployment\b.txt) -includeequal I have this script already. Can you help me how can iput this in an output...
View ArticleList all local groups
Hello,I have a problem while listing local groups via PS v2."net localgroup" runs fine: When I run PS ($obj.psbase.Children | Where {$_.psbase.schemaClassName -eq "group"}) it doesn't stop and program...
View Articlecan't match "\" at end of string
I have been trying to match the "\" at the end of string and it comes up false"Scripts\" -match '$\\' returns False"Scripts\" -match "\Z\\" returns Falsecan someone tell me the right syntax for...
View ArticlePowerShell - Email notification for failure of batch
Hi I am new to PS.I am executing SQL scripts via a batch file. PowerShell correctly exits the batch when a script fails. When that occurs I would like to send an email, or if no error occurs send...
View Articlereceiving error when running this script:
HI there,This is the script i'm trying to run so I can update mulitple user's company attribute:import=import-csvc:\import.csv foreach($userin$import) { $Name=$user.name $Company =...
View ArticlePOSH script or function how to add get-credentials?
Howdy All! How can I add something to function to get prompted for credentials?Here's what I've started, the function works but I don't know where to put the credentials part. I did add in the...
View Articlewin32_product not returning anything
Hi!Just started to learn powershell and I think I'm loving it :-) Anyways, trying to make a script to determine what roles are installed on a server. And if the roles are missing then install them.I've...
View ArticleCheck if Computer object exists in AD ?
I have a text file containing 100 server names. I would like to push these into a script and test wheather the computer object exists or if it has been decommissioned (deleted). From the results i can...
View Article