header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Search
Search Area
Criteria Options
Search Topics From
Search By User
Search in Forum(s)
Included Forums: ALL
Topic
RE: Freespace returning NULL
If it is a WMI issue, then getting the disk space a different way is solving the wrong problem. The only other way that I can think of off the top of my head would be to psexec a Dir on the remote machine and parse that.
by EBGreen in General PowerShell on 21 May 2012 10:32 AM
RE: Freespace returning NULL
My suspicion would be a WMI issue. Not all manufacturers populate WMI correctly (although for this class I would expect that to be rare). Also it is possible that the WMI repository is corrupt.
by EBGreen in General PowerShell on 21 May 2012 10:29 AM
RE: split with multiple parameters
I would do it like this: $lastaccessDate, $lastAccessTime = ($time -replace '.*\((.*)\)', '$1').split(' ')
by EBGreen in General PowerShell on 18 May 2012 10:59 AM
RE: split with multiple parameters
$time -match '\((.*)\)' $matches[1] Or to do it in one line: $time = $time -replace '.*\((.*)\)', '$1'
by EBGreen in General PowerShell on 18 May 2012 09:24 AM
RE: Amend items in an array
$test = @('johnsmith', 'paulsmith', 'petersmith') $test = $test -replace 'smith', '' $test john paul peter
by EBGreen in General PowerShell on 17 May 2012 06:16 AM
RE: Remote Event Log Parsing
It looks like the email portion is outside the foreach. I didn't notice that before. Try moving the instantiation of $summary to before the loop.
by EBGreen in General PowerShell on 16 May 2012 10:17 AM
RE: Remote Event Log Parsing
what is your actual code right now?
by EBGreen in General PowerShell on 16 May 2012 05:45 AM
RE: Bidemensional array with ddynamic size
Generally speaking, in my experience multidimensional arrays are usually easier using some other data structure. If you want to use them though, try this: $array[$a] = @() $array[$a,1]=$fil $array[$a,2]=$fil
by EBGreen in General PowerShell on 16 May 2012 05:10 AM
RE: Remote Event Log Parsing
The first thing that I see is that you are not getting the events from the remote machines. Change this line: $SysEvent = Get-Eventlog -logname application -After (Get-Date).AddDays(-1) #display results from the last day to this: $SysEven ...
by EBGreen in General PowerShell on 15 May 2012 10:52 AM
RE: Scheduled Job Behaves Differently
Scheduled jobs behavior issues are almost invariably a rights issue. Make sure that you are forcing the job to run with your credentials. If that does not work, I would try explicitly providing the credentials in the script.
by EBGreen in General PowerShell on 15 May 2012 05:50 AM
RE: Powershell concatenate and the split method
If I understand then try this: $messages | %{'Backup alert ' + $_)
by EBGreen in General PowerShell on 15 May 2012 05:31 AM
RE: DateTime Conversion Problem
Hmmm...this is odd. Here is what I get: $os = Get-WmiObject -Class Win32_OperatingSystem $os.LastBootupTime 20120504100757.610798-300 $os.ConvertToDateTime($os.LastBootUpTime) Friday, May 04, 2012 10:07:57 AM $os.ConvertToDateTime($os. ...
by EBGreen in General PowerShell on 11 May 2012 10:18 AM
RE: Error in Exchange server commands - get mailbox
Well the error message is pretty clear. sounds like you need to make sure that you are going over HTTPS or the IP needs to be in your TrustedHosts list.
by EBGreen in General PowerShell on 11 May 2012 10:05 AM
RE: get all child window titles
For what it is worth, using that command with a Citrix Outlook open and emails from that open I get the titles for outlook and all the email windows.
by EBGreen in General PowerShell on 11 May 2012 09:17 AM
RE: PowerShell script to save a file on a remote server
I have to be honest that I'm not sure that I understand exactly what you are asking.
by EBGreen in General PowerShell on 11 May 2012 09:14 AM
RE: Extract data from a colum in a CSV file and export to a text file.
Something like this should work: Import-CSV c:\scripts\bldqrysn\test.cvs | Select-Object Test1 | Export-CSV C:\scripts\bldqrysn\result.csv
by EBGreen in General PowerShell on 09 May 2012 01:29 PM
RE: ruby scripts to powershell
I would suggest doing what you can then posting specific questions when you have specific problems.
by EBGreen in General PowerShell on 09 May 2012 10:52 AM
RE: DataSet datatype bit export saves as boolean
What is the Type of the bit when it is being held in memory after the export. So what do you get from something like: $data[0].'Bit field'.GetType()
by EBGreen in General PowerShell on 08 May 2012 11:14 AM
RE: DataSet datatype bit export saves as boolean
Well, I don't know if it is the best way, but a fun way would be to use the Invoke-Ternary cmdlet (alias ?:). That with Select-Object would hopefully do it. So if you had the data in a variable called $data before the export, then something like: ...
by EBGreen in General PowerShell on 08 May 2012 11:01 AM
RE: save the results of the foreach loop in the hash for later use
I'm a little confused. There is more than one log file that you are reading from?
by EBGreen in General PowerShell on 08 May 2012 10:16 AM
RE: Delete one key value within a hashtable with more than one value assigned to a key
There are different methods available depending on what sort of collection it is, but this should be pretty universal: $hash['firstkey'] = $hash['firstkey'] | ?{$_ -ne 'datatwo'}
by EBGreen in General PowerShell on 08 May 2012 07:03 AM
RE: How to delete text in parentheses, that is contained within text file?
This would work to display the lines. You can do whatever you would like with them: foreach($line in Get-Content c:\path\to\file.txt){ $line -replace '\(.*\)', '' }
by EBGreen in General PowerShell on 08 May 2012 06:16 AM
RE: Ping Server Script (with Email)
I would start with these two commands: Get-Help Test-Connection -Detail Get-Help Send-MailMessage -Detail
by EBGreen in General PowerShell on 08 May 2012 06:14 AM
RE: Convert format-table output to xml
Try something like this: Find-NaController 192.168.0.5 | Select-Object type, address, description, name, model, systemid | ConvertTo-XML C:\path\to\output.xml
by EBGreen in General PowerShell on 07 May 2012 08:05 AM
RE: Inventory accuracy
Ok, so this is untested, but it would hopefully give you something to work with: $ipList = Import-CSV 'c:\temp\ip.csv' $result = @() foreach($ip in $ipList){ If(Test-Connection $ip -count 1 -quiet){ $name = [System.Net.DNS]::GetHostBy ...
by EBGreen in General PowerShell on 04 May 2012 10:40 AM
RE: Inventory accuracy
I'm sorry, but I'm having a hard time understanding exactly what you are asking. you want to take a list of IPs and from that generate a list of device names?
by EBGreen in General PowerShell on 04 May 2012 07:44 AM
RE: basic syntax question: "Calculate" string values to be used later on.
CalumPowell's solution is perfectly valid. Here is the piping way: $foo = 1..9 | %{'PC000' + $_}
by EBGreen in General PowerShell on 04 May 2012 07:40 AM
RE: PowerShell - robocopy/rsync fast compressed file transfer?
I have not done it, but there are articles on the web about using powershell to transfer files with BITS.
by EBGreen in General PowerShell on 01 May 2012 06:29 AM
RE: Pause for user intervention
To be honest, I think that if I understand your goal, you are over thinking it. When the submit button is clicked just check the validity of all the inputs. If any of them are invalid, pop up a message box explaining what is invalid and why but don' ...
by EBGreen in General PowerShell on 01 May 2012 06:28 AM
RE: How to remove duplicate lines from a text file, based on a pattern
Hmmm...so you get the key but no line for the value? Could you post the actual code that you are running?
by EBGreen in General PowerShell on 01 May 2012 06:12 AM
Page 1 of 3712345 > >>
Active Forums 4.3
right
footer   footer
footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
footer   footer