when the work look finished, the problems appear [DELETE EMPTY FOLDERS]
Hi!I've created this script$Remove=@() $Et1="0" $Et2="9" Get-ChildItem "C:\Test" -Recurse | Where-Object {(Get-ChildItem -Path $_.FullName) -eq $null} | foreach($_){ $Sav=Split-Path($_) -leaf...
View Article"Unable to find a default server with Active Directory Web Services running"...
Hey guys,Having some scripts that install some apps and provisions AD SQL and SharePoint and one main script that starts in background and calls my scripts. One of the scripts creates some AD accounts...
View ArticleExtract expiration dates and accounts from the Active directory (Server 2003)
Hello,I'm the assistant of the It administrator of my company and he asked me to list : the accounts that will expire between the 23th of december and the 7th of January.He wants to know : Name / Id...
View ArticleErrors Outputting to CMD Line Instead of File
I am writing a simple script. In the script I would like to output the errors to a file. I have tried a few different ways to output to a file but each always returns the error to the CMD line.$URL =...
View ArticleCluster information for multiple servers
I am trying to find out which clusters are available on a 10 servers by using import-module failoverclusters $Server = get-content Server.txt Get-cluster -computername $serverBut i am getting the...
View ArticleUnblocking PSM1 files not working
This may apply to other PS extensions, but PSM1 files is what I was working with. When I unblocked them, I was able to apply the change without any errors. However, when I returned to the properties...
View ArticleRecursive, filtered Deleting
looking to recursively look through the backup sql folders and if the folder contains a file like *_MASTER* , and if it's the newest file in the directory, then delete all of the other files in the...
View Article-Replace wont remove ?
HiThis is properly a simple question. Im trying to remove some question marks from a string, the data is this:The system has resumed from sleep. Sleep Time: ?2013?-?11?-?23T07:11:08.138616700Z Wake...
View ArticleAdd columns to PowerShell array and write the result to a table
Hi, I have one more question about PowerShell. I have this code to execute a stored procedure. $SqlSourceConnection.Open() $SqlCmd = New-Object System.Data.SqlClient.SqlCommand $SqlCmd.CommandText =...
View ArticleMicrosoft fixit gives an error message " Can't install Windows Power Shell"...
I am running Windows Vista SP1. The reason I am running SP1 is that my computer won't install some Windows updates including SP2. I can't install the newer version of Windows Explorer. When I try to...
View ArticleStart-Process ... -Wait not waiting in child script of Invoke-Command on...
I am using the following code to run a script that exists on a remote computer:$Sess = New-PSSession -ComputerName $Computers Invoke-Command -Session $Sess -ScriptBlock {Start-Process -FilePath...
View ArticleExtract Varible from the Query
Hi All,I am looking to extract required information from this command. "Get-ChildItem "F:\Softwares\PDF Editor\PDFEdit.exe" | Format-List -property *". This Command gives lots of information, I only...
View ArticleCreating a registry key on a remote machine
When using the follwoing to create a key, the result is not as expected. what is wrong? Thanks$baseKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("LocalMachine", $ip) $key =...
View ArticleInsert text after a match
My goal is to add text after the match. Howerve; the code below doesn't do anything. Apreciate your help.Example:Text before:192.1.2.41 - - [09/Nov/2013:00:13:00] 10.32.1.52 - - [09/Nov/2013:00:13:00]...
View Articlescript help
I have files sitting in a folder that need parsed and contents of those files emailed. The files contain the eye-catchers that I need to parse to create the email. The Who,Subject and ENDDATA...
View Articleintermittent : The term 'get-date' is not recognized as the name of a cmdlet,...
I have developed a batch harness whereby all scheduled tasks (W2012) invoke a common powershell script that acts as a wrapper to all our housekeeping jobs.The first step in the wrapper is to create a...
View ArticleAsk your advice on powershell
Hi all,I have finished Dow Jones' youtube learning powershell in lunches videos. Mostly time, I download scripts from internet and tweak into my needs. I hardly wrote my own scripts. Can anyone point...
View ArticleScript to revoke home folder permission
We are in the process of migrating file server to new hardware and need help with revoking permission to Home folders. We want users to manually copy onlymeaningful data from old home drive to new home...
View ArticleUsing PowerShell to parse local HTML files
Hey guys,I have a folder filled with HTML files, downloaded using Invoke-WebRequest, that I'm trying to parse.I've tried to accomplish this by creating a IE ComObject and opening the files using the...
View ArticleDifferent Results Remote vs Local Execution
Hello community,Working with powershell v2, I get hung up on problem.When I run the command "get-childitem -Recurse " on a remote machine using invoke-command, most of the Length values of the output...
View Article