PowerShell and Winforms
Hi,I have developed an vbs/hta application, and it's time to migrate it to powershell: we are going to implement new features, and everybody recomends use of Powershell.The app has lots of forms, and I...
View ArticleAD User report with LastLogon for every DC
HiI have a script i use to get user information for all users. The problem is that this customer has multiple DC's. Any ideas how i can get all lastLogon for each DC in the report?[CmdLetBinding()]...
View ArticleAdding users from multiple groups into a single report
# Setup input and output files $Input = "C:\grps.csv" $Output = "C:\grps_output.csv" # Load the AD module so we can access AD information Import-Module ActiveDirectory # Load our input file - a CSV...
View ArticleGet-WinEvent throws an error.
I am having an issues and I can not see why it is doing this. I have a script to access event logs and it will pull the data but at the end of the first unit I get en error message but it continues to...
View Articlefiltering a string in powershell
Hey,I'm seraching for a solution to filter text out of the active Directory infofield.I read the field via: $ADVariable.infoResult is a lot of text which starts with: [example]123456 [uninteresting]xyz...
View ArticleRunning follow SQL query either in Powershell or within SQL against multiple...
I am running into a mental block and trying to figure how I would run the following query against mulitple SQL servers. I thought about declaring a list within my query and simply running the query...
View ArticlePowerShell Script to find all instances of a named folder and delete all...
I am barely a beginner to scripting and PowerShell but I need to come up with a script that I can schedule to run on the a file server weekly.I need a script will find all "Example_Data" folders within...
View ArticleHow to propagate CmdletBinding parameters through Invoke-Command?
I have a set of scripts with the CmdletBinding attribute applied that run scripts on other servers.For example, I have a Stop-MyServices that stops my services on all my servers:function...
View ArticleWindows PowerShell Script Help
I found a Fourm that had a post on it by Richard Mueller that had a script he posted to help setup automation of adding users to a group with a PowerShell Script. The script works great, but I want to...
View ArticleClone VM script to change servername/sql instances/sharepoint
Hi Guys,Im looking for a easy why to change the computername after i cloned a machine..For Example i clone a machine with sql and sharepoint on it..Then when i booted the machine i need to change...
View ArticlePowershell WMI queries
HiI am trying to find out how to query the following settings using Powershell WMI, however have hit a wall. Is anyone aware?NIC name/ descriptionSpeed/DuplexOn the NIC, the following options enabled...
View ArticleScript for changing the paper source
Hi, I came across this Powershell script on the web, which does a good job of printing out PDFs: Start-Process -FilePath "C:\Users\Test\Documents\Listing.pdf” –Verb Print -PassThru | %{sleep 10;$_} |...
View ArticleTry, Catch, If, Invoke-Command and error handling
I'm still learning Powershell so please take it easy on me. Here is what I am trying to do, find a process called wview.exe on multiple remote computers, if wview.exe exist stop it + log it + increase...
View Articlecheck user account control setting for multiple servers
$servers="DEN-DC-01", "DEN-GW-01", "DEN-SRV-01","DEN-SRV-02","FTC-CL1-01" Function get-UserAccountControl ($server) { [string]$RegPath = "Software\Microsoft\Windows\CurrentVersion\Policies\System"...
View ArticleHow to set ScriptProperty
How can I achieve the next effect: (dir .\abc.txt).VersionInfo.Comments = "my comment"
View ArticleFind 3 character smtp prefixes
I'm trying to list all the users in my domain whose primary SMTP Prefix is 3 characters. I thought I could just do:Get-QADUser -sizelimit 999999 | where {$_.PrimarySMTPPrefix -like "???"} |...
View ArticleIs this a bug? Start-Service | stop-Service
Hello,I just ran into an interesting problem when stopping a service on a remote computer. Get-service -name healthservice # This returns my local healthservice, happily running Get-service -name...
View Articleget-psdrive and operators
I find this command works get-psdrive | ? provider -match "Registry" but get-psdrive | ? provider -like "Registry" or get-psdrive | ? provider -eq "Registry"do not work. I'm sure there's a reason but...
View ArticleExchange Users over Quota Limit.
I am trying to get a list of users which are over their quota limit. I would like to filter on the "_.StorageLimitStatus" field and only get back results on any value except BelowLimit,NoChecking or a...
View ArticleSet-ADAccountPassword issues after password reset
I found a wonderful script that allows me to bulk reset users passwords using the set-adaccountpassword cmdlet. The passwords change just fine but then when I set the user accounts to force a password...
View Article