inconsistent behavior of "where" filter command in remote powershell session
I've got a simple powershell script I've written to do a gpo backup (backup-gpo) to a remote file share, and then I launch a remote powershell session with "invoke-command" where I zip up the results...
View ArticleAssist with my SQL Reporting Script
I have started writing a HTML SQL reporting script based off of Jeffrey Hicks tutorialHere is my entire script:###################START SCRIPT######################################requires -version...
View ArticlePowerShell script to output all users who have no password expiry
Hi all,Trying to put together a quick audit script to output all users who have no password expiry. I'm also looking to filter this by only users who are enabled and users who's accounts have not...
View ArticleExchange Mark Message as Read
Does anyone know how to mark a message as read server-side in Exchange 2010? I was looking at:Set-MailboxMessageConfiguration -Identity $mailbox -PreviewMarkAsReadDelaytime 0but I think that only...
View ArticleUsing PowerShell to import CSV data from Vendor database to manipulate Active...
Hello,I have a big project I am trying to automate. I am working in a K-12 public education IT Dept. and have been tasked with importing data that has been exported from a vendor database via .csv...
View ArticlePowerShell script to produce a disk usage report like the UNIX du program ?
I need a PowerShell script to produce a disk usage report like the UNIX du program.There was one in an earlier thread (see below), but it is pretty...
View Articlehow to string replace "..." ?
How can I replace the string "..." ? $TEXT = $TEXT -replace ("...","") - returns gibberish. ".." is considered a special character/token for ranges. I'm not sure how to escape it. My goal is to...
View ArticleLabeled break statements in PowerShell
What is the difference between including a ':' (colon) in a labeled break statement and not including the colon? The documentation seems to indicate that a colon is necessary but it seems to work the...
View ArticleHow do you execute a PS script to run on multiple remote computers...
I have a PS script that accomplishes the following process: sets the start-up service attribute to "disabled", stops the service, kills process if its running, then copies updated files, sets start-up...
View ArticleImport Multiple Excel Into Sql Server
I have 4 Excel spreadsheets all with different formatting and column names that I want to use powershell to import into ONE Sql Server Table that I will want to create with powershell. I have found...
View ArticleReplace Part of DisplayName Using PowerShell
Hello,I am trying to replace part of a display name using powershell. For example, our display names look like this:"Lname, Fname/Department"I'm trying to replace only the department, basically what is...
View Articlepowershell restart-service on many computers
I need to remote restart a service on a bunch of machines. This command works great on a single machine: Restart-Service -InputObject $(Get-Service -Computer computer1 -Name service1);But I need to...
View Articleadding timeout limit to System.Diagnostics.Process
Hi, I am running an application perfcalc.exe by sending some parameters through "System.Diagnostics.Process". The purpose is, I want to receive back the exitcode and standard-output. It's working...
View ArticleInvoke-Command RDS, deployment does not exist
Hello, I am trying to invoke simple commands(like get-rdusersession) on RDS server from another server in domain. But I always get an error that the deployment does not exist on that server. Which is...
View ArticleManaging Workstation server from domain server
Hello,I am trying to manage server Foundation 2012 which is not joined to domain from domain computer. For that I need to run command:Set-Item WSMan:localhostClientTrustedHosts -Value...
View ArticleSetting up Variables for a Build of DCPromo Answer File.
Setting up Variables for a Build of DCPromo Answer File. The correct "dcpromo.ini" will produce an initialization of an execution of Forest called "mysite.com" setting up for a Forest...
View ArticleDSC - Website not working
Hi,I'm moving my first steps on dsc, I have a basic script to deploy a web site, but the resource website is completely ignored.I have defined thenresource website between ASP and TailspinSourceFiles...
View ArticleDSC - how to open firewall port for a site in IIS
I've used this configuration trying to open a port where I've configured a web site xFirewall Firewall { Name = "TailpinToys Dev" DisplayName = "Firewall...
View ArticleHelp Splitting strings from the HOST file
Good Afternoon,I am working on a function that reads the host file to make it eaiser to see if a seat is missing an entry at work. I would like to split the each line into the IP address and the HOST...
View ArticleEncoding with IO.File
I need to reada large file (1,5 Gb).For performance issues, I'm trying to use the [IO.File] instead of the Get-Content, but am having trouble withaccents.If I'm not mistaken,my fileis ANSI.Follows the...
View Article