All PS scripts in windows scheduler suddenly don't work anymore
I have four PS scripts executed daily by windows scheduler and suddenly two weeks ago all stopped working. I checked also if windows (7 home premium) installed new updates, but there was only windows...
View ArticlePowerShell 3.0 - Conditional operator wrong behaviour!??
Hi there! I am a VS C# programmer. Now I am learning PowerShell 3.0During learning, I tried to make a block of codes for identifying input number's type. The code is:#Starting of blockcls $a =...
View Articleneed help with powershell command
hello .i want to add to a multiple ad groups a multiple ad users with powershell command.how can i do this in the esaly way?i try this but itsn't works$groups=Import-Csv C:\groups.csv$users=...
View ArticlePS beginner Help
I have been tasked with something that most of you can probably do in 2 minutes.Here is what it is, I have a monitoring softaware that will run .bat or powershell scripts I have to create one or the...
View ArticleGet-LocalGroupMembership - Script/Module Help
Sorry, I don't have access to pastebin at work (blocked) but I need some help with a module. This is the closest that I have found to do what I need, but it is way more complicated than I have skill...
View ArticleCustom provider Get-Item() : How do I format output in a custom provider
I'm starting to write my first custom provider. All the examples I found use WriteItemObject() to display data to user. The output appears to display all public property names : Value e.g.PSPath :...
View ArticleCall function with parameters invoke -command powershell
hey Guys,Need help in invoking function remotely I get error invalid function. let me know what is missingerror message nvoke-Command : Cannot validate argument on parameter...
View ArticleSetting System Time with PowerShell
How can we modify or change system time (not date) using windows powershell? I was trying to change system time by below command:-set-date -adjust "Monday, October 17, 2011 5:35:25 PM"But it throws...
View ArticleExport list of Virtual Machines in Azure
Hi all, I'm trying to find a way to export to CSV a list of all VM's against my Azure subscription.<o:p></o:p>I seem to be going around in circles - some scripts look promising, some just...
View ArticleCan see values from parsed JSON object, but they present as null on PSv2
Code:[System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions") | out-null $web_client = new-object system.net.webclient $npi="randomNPInumberfromNPPES" $jsondownload =...
View ArticleHow to enable Cred SSP on DC?
Hi,I want to enable basic (HTTP) cred ssp between 2 servers.How can I add SPN on the client machine, which command.and which exact CMD should I run on server.Sorry completely new to this. Thanks in...
View ArticleTo update(Add or remove user)in "Lock pages in memory"
Dear Experts.... Can some guide with a powershell script to add or remove a user in the Lock pages in memory.GPEDIT-> Computer Configuration -> Windows Setting->Security Setting-> Local...
View ArticlePossible to run advertised programs with Powershell
Hi all so where I work we re-image the machines about every 6 months typically we log into them, go to control panel and select from 2 images (advertisements x64 or x86). My question is could I...
View ArticleHow do you get account that powershell session is being run under?
Anybody know a trick to do this? The $env:profile returns the profile that is being used to logon to Windows. I want to return the account that is being used to run the session when I do a "runas"....
View ArticleImport-CSV is blank and empty
My CSV looks like thisName,Address Dave,Dave@dave.com Dave,Dave2@dave.com Dave,Dave3@dave.comI've stored this on my C:drive, called it 'alias.csv' and ran this command:PS C:\>Import-CSV "alias.csv"...
View ArticleDelete files older than 24 hours
Hi guys,with your help I created this script that delete from a folder all the files older than 14 days and keep just 1 for day from today to 14 days ago.I need that ALL the files in the last 24 hours...
View ArticleOptimal way to read big log files
Hey There,I have multiple servers with 2+ GB log files. I need to search certain string from each logs files and pipe result to another file. For the search I use the following...
View ArticleHow to Execute Batch and Jar File Remotely
Hello,I need to execute a batch file (.bat) remotely. The bat file is used to start a jar file. I've tried several scripts:invoke-command -scriptblock {start-process xxx.bat} -computername...
View ArticlePowershell Split file at a word
Hello I am trying to split a file Everytime it finds the Word SPLIT The below did not work $Path = "C:\Users\PLW\Desktop\a\" $InputFile = (Join-Path $Path "File.txt") $Reader = New-Object...
View ArticleBulk email domain change
I am trying to find the PS script to update multiple users to a new domain in office 365, leaving existing domains as the alias. I have used a command in the past successfully:Import-CSV...
View Article