![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Newbie output question Hey all, I just started with powershell last night and I am loving it so far. I wrote this. $ser = Get-Content c:\wmitest\servers.txt Get-WmiObject win32_osrecoveryconfiguration -computername $ser | Format-Table It works as far as getting the data I am looking for. I am wanting to output the server name (taken from the txt file) and the data. I can format what it gives me several ways but can not get the server name (off the servers.txt file) to display Thanks |
| | #2 (permalink) |
| Guest | RE: Newbie output question Is there any reason to use the server name from your text file, instead of the server name on the WMI object? Get-WmiObject win32_osrecoveryconfiguration -computername $ser | Format-Table __Server, DebugFilePath, Name -auto And, welcome to Windows PowerShell! -- June Blender [MSFT] Windows PowerShell Documentation Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights. "Damon" wrote: > Hey all, > I just started with powershell last night and I am loving it so far. > I wrote this. > $ser = Get-Content c:\wmitest\servers.txt > Get-WmiObject win32_osrecoveryconfiguration -computername $ser | > Format-Table > It works as far as getting the data I am looking for. > I am wanting to output the server name (taken from the txt file) and the data. > I can format what it gives me several ways but can not get the server name > (off the servers.txt file) to display > Thanks |
| | #3 (permalink) |
| Guest | RE: Newbie output question Hey June thanks for the fast responce. The server name on the WMI object should be OK. I typed Get-WmiObject win32_osrecoveryconfiguration -computername $ser | > Format-Table __Server, DebugFilePath, Name -auto and it gives me a table with _server in the header but no data under it. The rest still works well, but I do not have the server name show up. My goal is to have a table with the server name and then name -auto. Thanks again for the help. "June Blender (MSFT)" wrote: > Is there any reason to use the server name from your text file, instead of > the server name on the WMI object? > > Get-WmiObject win32_osrecoveryconfiguration -computername $ser | > Format-Table __Server, DebugFilePath, Name -auto > > And, welcome to Windows PowerShell! > -- > June Blender [MSFT] > Windows PowerShell Documentation > Microsoft Corporation > This posting is provided "AS IS" with no warranties, and confers no rights. > > > > "Damon" wrote: > > > Hey all, > > I just started with powershell last night and I am loving it so far. > > I wrote this. > > $ser = Get-Content c:\wmitest\servers.txt > > Get-WmiObject win32_osrecoveryconfiguration -computername $ser | > > Format-Table > > It works as far as getting the data I am looking for. > > I am wanting to output the server name (taken from the txt file) and the data. > > I can format what it gives me several ways but can not get the server name > > (off the servers.txt file) to display > > Thanks |
| | #4 (permalink) |
| Guest | RE: Newbie output question Thanks again June, That did work, I was not putting two underscores in front of the server. Thanks "Damon" wrote: > Hey June thanks for the fast responce. > The server name on the WMI object should be OK. > I typed > Get-WmiObject win32_osrecoveryconfiguration -computername $ser | > > Format-Table __Server, DebugFilePath, Name -auto > and it gives me a table with _server in the header but no data under it. > The rest still works well, but I do not have the server name show up. > My goal is to have a table with the server name and then name -auto. > Thanks again for the help. > > "June Blender (MSFT)" wrote: > > > Is there any reason to use the server name from your text file, instead of > > the server name on the WMI object? > > > > Get-WmiObject win32_osrecoveryconfiguration -computername $ser | > > Format-Table __Server, DebugFilePath, Name -auto > > > > And, welcome to Windows PowerShell! > > -- > > June Blender [MSFT] > > Windows PowerShell Documentation > > Microsoft Corporation > > This posting is provided "AS IS" with no warranties, and confers no rights. > > > > > > > > "Damon" wrote: > > > > > Hey all, > > > I just started with powershell last night and I am loving it so far. > > > I wrote this. > > > $ser = Get-Content c:\wmitest\servers.txt > > > Get-WmiObject win32_osrecoveryconfiguration -computername $ser | > > > Format-Table > > > It works as far as getting the data I am looking for. > > > I am wanting to output the server name (taken from the txt file) and the data. > > > I can format what it gives me several ways but can not get the server name > > > (off the servers.txt file) to display > > > Thanks |
| | #5 (permalink) |
| Guest | RE: Newbie output question Glad it worked for you. One great habit to develop is to send every object that you get to Get-Member, and then examine all of its properties and methods. Then, get an instance of the object and view the values of all of its properties. You can also look up the object on MSDN and read about the properties and methods. You can search the help, too: function search-help { select-string -path $pshome\*.txt, $pshome\*dll-help.xml -pattern $args[0] } E.g. search-help regex That will get you 80% of what you need. For the remaining 20%, ask the experts. ![]() -- June Blender [MSFT] Windows PowerShell Documentation Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights. "Damon" wrote: > Thanks again June, > That did work, I was not putting two underscores in front of the server. > Thanks > > > "Damon" wrote: > > > Hey June thanks for the fast responce. > > The server name on the WMI object should be OK. > > I typed > > Get-WmiObject win32_osrecoveryconfiguration -computername $ser | > > > Format-Table __Server, DebugFilePath, Name -auto > > and it gives me a table with _server in the header but no data under it. > > The rest still works well, but I do not have the server name show up. > > My goal is to have a table with the server name and then name -auto. > > Thanks again for the help. > > > > "June Blender (MSFT)" wrote: > > > > > Is there any reason to use the server name from your text file, instead of > > > the server name on the WMI object? > > > > > > Get-WmiObject win32_osrecoveryconfiguration -computername $ser | > > > Format-Table __Server, DebugFilePath, Name -auto > > > > > > And, welcome to Windows PowerShell! > > > -- > > > June Blender [MSFT] > > > Windows PowerShell Documentation > > > Microsoft Corporation > > > This posting is provided "AS IS" with no warranties, and confers no rights. > > > > > > > > > > > > "Damon" wrote: > > > > > > > Hey all, > > > > I just started with powershell last night and I am loving it so far. > > > > I wrote this. > > > > $ser = Get-Content c:\wmitest\servers.txt > > > > Get-WmiObject win32_osrecoveryconfiguration -computername $ser | > > > > Format-Table > > > > It works as far as getting the data I am looking for. > > > > I am wanting to output the server name (taken from the txt file) and the data. > > > > I can format what it gives me several ways but can not get the server name > > > > (off the servers.txt file) to display > > > > Thanks |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Newbie question | Steve Grosz | PowerShell | 6 | 05-29-2008 07:34 PM |
| Newbie question | Bare Foot Kid | Graphic cards | 2 | 04-12-2008 05:38 PM |
| Newbie - Output to a text file problem. | Kryten | PowerShell | 9 | 10-11-2007 04:46 PM |
| Newbie question | JasonJFT | PowerShell | 6 | 09-09-2007 04:40 PM |
| RE: Newbie Question | cccstar | PowerShell | 0 | 12-18-2006 02:31 PM |