Powershell Remove all text after last instance of \
Hi Guys ,I have some codeText$s = "c:\programfiles\tv\version8\uninstall.exe" $s.Substring(0, $s.lastIndexOf('\')) echo $s when it prints , it shows both Textc:\programfiles\tv\version8\...
View ArticleCleanup Windows Backup Data Directories using Powershell and Output to text file
I'm pretty new at powershell scripting so sorry if this is rough. The script is being executed on a Windows Server 2012 R2 Machine with Powershell v4.0. The N:\ drive that is being referred to below is...
View ArticlePowerShell Hero's 2016
As you may or may not know, 2 Spiceheads made PowerShell Hero last year: http://community.spiceworks.com/topic/744795-powershell-org-announces-its-powershell-hero-s-for-2015Incredible as it seems, a...
View ArticlePowershell Team Posts Their Pester Tests
If you haven't been convinced to start using Pester to test your Powershell code yet, this should convince you:https://github.com/PowerShell/PowerShell-TestsThe Powershell team is leveraging Pester as...
View ArticleMandatory Parameters
OK, this is my first foray into requiring user input to one of my scripts, and I thought I had this down before I attempted it, but it just stuck it's tongue out at me and screamed "N00b!" in red...
View ArticleRemove 'Password Never Expires' flag
HiI have a list of users in a security group whose passwords are currently set to never expire. I would like to change this and bring them under the default password policy for the domain. I am going...
View ArticleAutomatic birthday reminder script issues (Powershell)
Hello!I decided to write up a simple PS script that uses a CSV file, checks the dates and sends everybody an e-mail regarding that birthday. So far I tested the e-mail message and turned out to be...
View ArticlePowershell Script
Hello All,I am trying to write a powershell script to do the following for all my computers in my network. (Active Directory)If Administrator is disabled then enable Administrator (local)Set local...
View Articleveeam service stop via powershell & batch file
I have created a powershell command to stop all veeam backup services but need to get it to run via a batch file ( Powershell needs to be ran as administrator too ) .
View ArticleFun with the PowerShell Prompt
Just to have a bit of fun today, after working with a couple of Linux systems, I decided I wanted to try and make a more useful and attractive prompt than the default one. On Linux, I've always liked...
View ArticleWhy won't this work? Resetting AD Passwords with powershell
Powershell$resetButton.Add_Click({Set-ADAccountPassword$NameTextBox.Text-NewPassword(ConvertTo-SecureString-AsPlainText-String$passTextBox.Text-force)})I am trying to run the above code from a form I...
View Article2016 PowerShell Heroes
As you may or may not know, 2 Spiceheads made PowerShell Hero last year: http://community.spiceworks.com/topic/744795-powershell-org-announces-its-powershell-hero-s-for-2015Incredible as it seems, a...
View ArticlePowerShell Command to remove contacts from AD OU based on a txt file.
Anyone have a PowerShell script that removes specific contacts from an AD contact OU, based on a txt file list.
View ArticleCopy, Rename, and Move at once
In Powershell, I'm trying to take a number of files lets say.test_20151209.xlstest_20151210.xlstest_20151211.xlsCopy them. Rename all the test_*.xls files with _O at the end (ie, test_20151209_O.xls...
View Article90 day script
Hi Is there a way of running a script when users change passwords every 90 days via gpo and or if they just change itI have looked but cant seem to find anything in adand I am new to powershell.scripting
View ArticleThe Powershell Guys Are Killing It!
See this post at the Spiceworks Water Cooler:https://community.spiceworks.com/topic/1334466-and-the-spiceheads-with-the-most-best-answers-and-hel...Craig Duff and Martin Pugh (and I!) got mentions...
View ArticleRestart a computer remotely using powershell AND prompt for computer name AND UN
Hi Spicers, I'm looking for some help with a script to restart a workstation remotely. When I do this I run the command restart-computer computernamehere -force -credential "domain\username"HOWEVER now...
View ArticlePowerShell or PowerShell ISE?
Hey guys and gals.For discussion today, do you use PowerShell or PowerShell ISE and why? Whats the difference between the two?Aaaaaand, go.
View ArticlePowerShell Summit 2016
Good morning,I was wondering if any of the fine Spiceheads were planning on going to the PowerShell summit next April? I went earlier this year, and it was fantastic. I got to hear talks from Jeffrey...
View ArticleScripting installation of microsoft Outloook 2010 for 32bit or 64bit version
I would like someone tell help me with a script that will be applied to a group policy that looks at the version of Microsoft outlook version 32 bit or 64 bit and install a program based on the output...
View Article