how to go out from loop to the beginning of the code
HI, I have a code with few rows, then I have "If" condition, I want that if the condition is true then jump to row number X. 1. ...........2. ..........3. ...............4. ..............5. if(x -eq...
View ArticlePowershell Gui Script? Start/Stop service on a remote server
I need to stop/start a service on a remote pc. I need to create some kind of application where I can give a non admin a gui where they can hit stop to stop a service on a remote pc and then start to...
View ArticleInvoke command GCI
Hallo, i have the following script, everything works until the invoke command, if i replace the $profilepath with the actual path "c:\..." then it works. does somebody know where i go wrong ?...
View ArticleMaking all users in a group change their password the next time they log on?
Yesterday, I created and ran a script which added ~900 users to Active Directory and added them to a group called Teachers. I used one of the default passwords that our IT Department came up with for...
View ArticleRemote remove outlook Profiles
Hi all, another question, i want to remote remove outlook proiles on a windows 7 desktop. does anybody know a good script for this , all desktops are member of a domain. Thanks.. you guys are a...
View ArticleSystem.Windows.Forms.OpenFileDialog always ontop
Hello Allwhen using the following code to present a browse for file dialog to a user, sometimes the windows will open behind another windows and therefore cannot be seen. I know I have seen a tip...
View ArticleTest-connection is slow
This is my first post, i have only been using PowerShell for maybe a week (mostly failing miserably) I finally got it to query AD and write a csv of computers in our domain (using an LDAP query i...
View ArticleProblem with Invoke-WebRequest
I'm trying to download files from an array into a specific folder but getting a Server error 404. Invoke-WebRequest : Server Error 404 - File or directory not found. The resource you are looking for...
View ArticlePowerShell Great Debate: Capturing Errors
Hot on the heels of our last Great Debate, let’s take the discussion to the next logical step and talk about how you like to capture errors when they occur.Read More
View ArticleHUGE powershell inventory script for ConfigMgr 2012
This is quite huge for me, because I’ve been working on this script for the last two months and finally decided, after sending the latest version to some “beta testers” and getting some nice results,...
View ArticleFanfare for the Common Parameter Part 2: Error
Last time we began a series of lessons on the common parameters you get with every cmdlet and advanced PowerShell function. If you want to get a jump, read the help topic About_CommonParameters. This...
View ArticlePowerShell Basics: System Requirements
No two Windows OSs are the same, just as no two versions of Windows PowerShell are the same. The steps you take to run PowerShell 2.0 on Windows 8 are much different from those needed to run PowerShell...
View ArticleAdd JPG to form
Hi,here is a basic form code :Add-Type -AssemblyName System.Windows.Forms$Label = New-Object System.Windows.Forms.Label$Form = New-Object system.Windows.Forms.Form$Form.Text="Date"$Form.AutoSize =...
View ArticleGet-ChildItem to get directories and files.
I want to use Get-ChildItem to get the directories and files into one object. Normally this command will return two objects, directory and file. I would like to get each file and know what directory it...
View ArticleCool RegEx Tip, replace text and count replacements in on go
Hello AllI was playing around with RegEx again today (yes I really do need to get out more), and wounded if I could replace text and count the replacements at the same timeTherefore I was looking at...
View ArticleRegEx Tip, Replace String set number of times
AllHere is another quick tip, last one lets say you have a string "AA124BB55HH657AAR555" now you want to replace the numbers (but only where there are 3 numbers together, not just 2) with say a #...
View ArticlePowerShell Basics: Console Configuration
The Windows PowerShell console provides an easy-to-use environment for creating and running PowerShell commands as well as generating script files that you can run at a later time. The more you work in...
View ArticleCheck if hardware is connected on Serial port
Is there a script that could help me if an item or device is connected to a serial port on a remote computer? Thank you,Von
View ArticleUsing variables
Hi, I run a code that have form with button, when I press the button I'm doing operations in variables,I want to use those variables after I use the button, for example:1. ..........2. ..........3....
View ArticleImport data from Powershell to SQL Server
Hi everyone, Not sure of this is the easist way. But id like to get a list of all the Servers in AD into a table in SQL Server. I can get the list of servers from AD in powershell. But i cant find a...
View Article