Windows Management Framework 5.0
: What's included in Windows Management Framework 5.0?A: Previous versions of Windows Management Framework (WMF) have included new versions of PowerShell, in addition to Windows Management...
View ArticleAdd users into AD Security Group
I need to add from a list of users to an AD security group.I now work in a new company and no one know PowerShell (I'm so alone)I've google and have come up with the script below.My CSV will have a...
View ArticleCreate contacts frm CSV
Hi,The following script$Path = 'C:\csv\contacts.csv'Import-Csv$Path|ForEach-Object {New-ADObject-TypeContact-Path"OU=Contacts,OU=WLB,DC=Domain,DC=local"-Name"$_.DisplayName"-OtherAttributes...
View ArticleScheduled Tasks with group managed service accounts
I am trying to create a scheduled task via powershell on a remote machine using a group managed service account as the scheduled task principal. The commands I run are below $hostname =...
View ArticleClean Up SQL Server Logins and Users with PowerShell
Unless you've got a well-defined strategy to manage SQL Server logins and database users via Active Directory groups (as I usually recommend when setting up SQL Server security), you're going to...
View ArticleCreate PowerShell Scripts Faster with the Script Browser and Analyzer
The Windows PowerShell Integrated Scripting Environment (ISE) is a useful tool for writing and testing scripts, and Microsoft has recently released a new ISE plugin that can help you develop PowerShell...
View Article[ordered] attribute to sort hast table, but what language construct is this?
I recently learnt that in order to sort a hastable, you need to prefix the construction of the hash with [ordered] (works for Powershell Version 3+).eg, to create an empty hash:$allCounts =...
View ArticleRun script against active directory group
Is there a way to invoke-command against an entire active directory group rather than having to write down each computer you want to run a script against?
View ArticleCitrix Provisioning Services PowerShell scripts
In the article series Unattended Installation Citrix Provisioning Services I already touched the PowerShell possibilities of PVS showing how to configure farm and server settings via PowerShell. In the...
View ArticleRemoting - Reporting on more than one service, sending email in html format
Hi - I have a script that works great and looks like this below. The problem is that I only want to know when anyone one of those services is stopped. Can anyone assist?[string]$Body=Invoke-Command...
View Articleformatting strings
I need to create a new registry key and I need double quotes to go around what I write to the registry. $Value="cscript c:\windows\MGH\Machine Printer.vbs" I need to write that to the registry but the...
View ArticleSecond-Hop CredSSP
I am having trouble getting the second-hop issue to work properly. I am trying to remote into Computer B from Computer A and then have Computer B install a program from Computer C. I enabled...
View ArticleQuestion on Inputs from .txt
Hi all, thanks for any help on this one, been scratching my head and google'ing but found nothing so far. (I'm new to powershell, so I might be looking in the wrong area)I have a normal .txt (no...
View ArticleComputer Field Missing
The results file doesnt put the computer name from the list. How do I define it in my script? $strMachineName = import-csv C:\temp\PCS.csv$results=foreach ($line in $strMachineName) { try {...
View Articleis it possible?
I want to create a directory with a .ps1 file and then copy the text of the file from the beginning and put it inside the created directory with a .ps1 extension. Something like...
View ArticleAccess Remotes Mapped Network Drive
I am working on a script that installs a .exe on to a remote computer. I have that working no problem. However, the program does not work correctly if I install the program directly off a file server....
View ArticleOutput name of file in Foreach-object command?
Good morning I feel like I've done all the most difficult bits of this so far, but am struggling with the basics :) I have a file with a date and time in seperate fields, I need to know how many rows...
View ArticleRemote Registry
I am trying to start the remote registry service for each PC to fetch a value from the registry but going nowhere. $Computers = import-csv C:\temp\PCs.csv$results=foreach ($Computer in $Computers)...
View Articlereplacing more than one character in a variable
Hi, I would think there's a way to replace more than one character with one replace but cannot find an example anywhere. $str1=' A_PROCESS_DATE, ACOUNTRY)' I want to get rid of ',' ')' and multiple...
View ArticleLab Ops – PowerShell 4 and KPI
In a Remote Desktop Services lab setup involving a gateway to allow connections to our virtual desktops over the internet we are going to need to use an SSL certificate to secure traffic between the...
View Article