General Error handling
Hi everyone! I have a little question regarding error handling in Powershell. When comparing my scripts to others I get a feeling that im constantly "overworking" my scripts.I put A LOT of effort into...
View ArticleShare Permissions
(Please visit the site to view this media)HiI've read a post on your site regarding this topic but I don't believe a solution was ever reached. Is there a way to get 2 specific shares and their...
View Articlestart-process question
I'm running a curl command to upload a file to a server. It appears that this command writes to stderr in order to give status of how far it is in the upload process. Writes several lines. I want to...
View ArticleWhat If - Changing Performing Operation
I am trying to change what the -whatif parameter presents when running on a script. Currently it pulls the function name after "performing operation". Is it possible to change this?Example -What if:...
View ArticleError Handling
Hello - I am new to powershell and am still having some issues understanding the exception handling portion but I need to grasp this better. I am running a script that checks the status of a specfic...
View ArticleWindows XP - scheduled tasks, Start only if the following network connection...
In Windows 7 is available option "Start only if the following network connection is available" in proporties scheduled tasks.I want create scheduled tasks in Windows XP that:- run selected program if...
View ArticleCreate Custom property within an object as a date
So, im back at it again and i'm stumbling.. Im taking a string from an output of a command and i'm converting it to date time with this$day = [datetime]::ParseExact("$a","ddMMMyyyy",$null)$a is = to...
View ArticleGetting UUID
Hi does anyone how to write a script to remote computers UUID?Thanks for the help in advance
View ArticleCopy a text file from local pc to Windows VM using Powershell
Hello, I need to copy a text file form my pc into the Windows 2012 Vm and I should do it using powershell. I can connect to VM using Powershell remoting. I tried the following command but they don't...
View ArticleDelete files from remote server
I am having 50 windows server out of whicn 20 are windows 2003 and 30 windows2008In windows 2003 server i want to deleate files from folder C:\abcIn windows 2008 server i want to delete files from...
View ArticleDelete Bulk Computers
Hi Dear,I am looking for a way to delete multiple computer objects from a txt file. I was able to get script to Disable Bulk Computers, but I am finding it hard to get for deletionI have been trying...
View ArticleInstalling Multiple MSI PowerShell Script
I am attempting to install multiple msi files with a powershell script. I am receiving the MSI prompt for each file and reviewing I cannot see why. This is what I have thus far thank you:#MSI...
View ArticleWrite-Host Seems to Truncate Strings.
Here is what I am running, but it seems write-host truncates the $error variable when passed to it. Output is below the code.How can I get the error into a string and output to log...
View Articlecopy file to multiple computers
Hiim trying to copy a file from one computer to multiple servers.I want to use a txt (Srvlist.txt) file containing the servers name.but I get an error that the path cannot be found.I can copy the file...
View ArticleCannot get CPU value to show on a remote computer
When I run a script I have been working on the value for CPU and Path is blank. I have racked my brain trying to figure it out but cannot. Being new to PowerShell its frustrating. What have I done...
View ArticleCan't script the schema for a FK
Hi,I use the below script to script out FKs in a database:#DECLARE TIMESTAMP FOR THE FILES$timestamp = Get-Date -Format yyyy-MM-dd#SCRIPTSL SQLSERVER:\SQL\'MyServer'\DEFAULT\Databases\'MyDB'\Tables$so...
View ArticleCreate a service with instsrv.exe & srvany.exe
Hi,This is my script : $User="Domain\DomainAdminAccount"$Password=Cat"\\x.x.x.x\share\credentials.txt" | ConvertTo-SecureString Copy-Path"\\x.x.x.x\Instsrv.exe"-Destination"c:\program files...
View ArticleExecute adamsync from another host
Hi all, How can I remotely execute adamsync command?Use the following command:Invoke-Command -ComputerName hostname -SCriptBlock {c:\Windows\ADAM\adamsync /sync hostname:389...
View ArticleUnable to get .GetGeoIP() from April 17 PowerTip to work
The PowerTip looks simple enough and usefull, but any methods I call using the WebServiceProxy fails with a useless error (bold):Exception calling "GetGeoIPContext" with "0" argument(s):...
View ArticleHow to link the output from win32_diskdrive and win32_volume
Hi,I am doing some analysis on multiple servers and am looking at ways to link the output from the following 2 lines:Get-WmiObject win32_volume | Select SystemName, name, Label, DriveLetter,...
View Article