Support Forums

Search found 10807 matches

by jvierra
Sat Mar 27, 2010 1:50 am
Forum: Windows PowerShell
Topic: Powershell exercise
Replies: 3
Views: 670

Powershell exercise

Your homework is an excersize to help you understand. Take a crack at writing this and we will help you to see what you are missing or doing wrong. I don't think anyone her wants to do your homework for you as we all hate homework and left it behind when we graduated from elementary school. Now we a...
by jvierra
Fri Mar 26, 2010 5:00 am
Forum: Windows PowerShell
Topic: Reading files
Replies: 6
Views: 462

Reading files

This is much clearer and easier: $SP_IPAddress = Get-Content C:tmpipaddresses.txt For($i = 0; $i -lt $SP_IPAddress.Count; $i+=2){        $PingIPA = $SP_IPAddress[$i].Split("=")[-1]     $PingIPB = $SP_IPAddress[$i].Split("=")[-1]     If(Test-Connection $PingIPA -q -count 1{         RunCXNaviCLIComman...
by jvierra
Fri Mar 26, 2010 3:51 am
Forum: Windows PowerShell
Topic: outputting object several ways
Replies: 6
Views: 521

outputting object several ways

Here is a function that turns around the elements of the first function. Try it: function Get-ShareUsers($user){ $user.Users | %{ $_|%{ $_|Add-Member -MemberType NoteProperty -Name "Share" -Value $user.Share -force $_ } } } $usershares=Get-ShareACL alphausers</strong> Get-ShareUsers $users...
by jvierra
Fri Mar 26, 2010 3:14 am
Forum: Windows PowerShell
Topic: Check if .....
Replies: 2
Views: 239

Check if .....

These are all usable answers however they miss some of the subtler points of PowerShell. Try it this way: gwmi Win32_Printer | select name gwmi Win32_MappedLogicalDisk | select ProviderName The third example with -contains is a good way to do that. The earlier ones would be slowere and they really m...
by jvierra
Fri Mar 26, 2010 2:03 am
Forum: Windows PowerShell
Topic: outputting object several ways
Replies: 6
Views: 521

outputting object several ways

With newly posted version of you function you can do this.

Get-ShareACL alphausers | select AccountName,manager,users

If you need more formatting then use hashes to refprmat individual columns.
by jvierra
Fri Mar 26, 2010 1:45 am
Forum: Windows PowerShell
Topic: outputting object several ways
Replies: 6
Views: 521

outputting object several ways

That's correct. That is the way sel;ect object works. It is a filter. What is it you are trying to do? Use hashes to reorganize or reformat output. Use ExportTo-HTML, Format-Table to arrage presentaion. get-shareacl hostshare | select AccountName,manager OR get-shareacl hostshare | select -expand Us...
by jvierra
Thu Mar 25, 2010 11:05 am
Forum: Windows PowerShell
Topic: function output won't save in variable
Replies: 10
Views: 879

function output won't save in variable

Here is your code fixed. I had some time so I tackled it. I removed all extraneous comments. Comments at eh end of ewach loop or block may seem to be useful but they really just create a lot of visual noise. Indenting and proper use of brackets makes the code visually accessible. White space is 'C'-...
by jvierra
Thu Mar 25, 2010 7:04 am
Forum: Windows PowerShell
Topic: function output won't save in variable
Replies: 10
Views: 879

function output won't save in variable

All of this can be handled in the pipeline as I have shown. You can process the objects and filter on user or group and add to teh objects in each pipe. $results | handle user type $results | handle group type in each pipe you add the properties you need. Not that all pipes should create identical o...
by jvierra
Thu Mar 25, 2010 6:19 am
Forum: VBScript
Topic: Need help making changes to an AD VBS script.
Replies: 8
Views: 1245

Need help making changes to an AD VBS script.

A user can belong to more than one group. A CSV would only have one line per user. How would you account for the mutliple groups. Same is true for excel.

by jvierra
Thu Mar 25, 2010 6:11 am
Forum: VBScript
Topic: Need help making changes to an AD VBS script.
Replies: 8
Views: 1245

Need help making changes to an AD VBS script.

Hey - that's a good script to start with. Now try to make the changes you need.

How are you going to get all of teh groups into a CSV by user. CSV is a flat tabuular representation and not a hierarchical rep.


Go to advanced search