A litttle help formatting output from powershell?
Hi all, I am working on a software inventory project and am (as will become obvious) a novice at powershell. I have the script running so I get what I need, but the formatting is borderline un-useable. I would like to see if anyone can point
me in the direction of creating one or two of the following: a single, collated file of all installed programs on all computers in the OU, filtered for duplicates (ie, only unique entries, not 37 instances of Office 2010 Service Pack 2), and/or an excel worksheet
with a page for each pc in the OU, and the list of installed programs on each page. This is what I have so far:
$rtn = $null
Get-ADComputer -filter '*' -searchbase 'ou=levy chd, dc=doh,dc=ad,dc=state,dc=fl,dc=us'|
ForEach-Object {
$rtn = Test-Connection -CN $_.dnshostname -Count 1 -BufferSize 16 -Quiet
IF($rtn -match 'True') {write-output $_.name | out-file C:\chd38computers_ping=true.csv -Append }
ELSE { write-output $_.name | out-file C:\chd38computers_ping=false.txt -Append }
$computers = Import-Csv "C:\chd38computers_ping=true.csv"
foreach($obj in $computers){
Get-WmiObject -Class win32reg_addremoveprograms | Select DisplayName,Publisher,Version,Installdate | Sort Publisher -Descending| Export-Csv d:\installed_apps.csv -append
Thanks in advance for the help!
adam
To filter out duplicates, you can use the -unique switch for Select here:
Get-WmiObject -Class win32reg_addremoveprograms | Select DisplayName,Publisher,Version,Installdate -unique | Sort Publisher -Descending| Export-Csv d:\installed_apps.csv -append
To manipulate excel file from Powershell you will need to use New-Object -ComObject "Excel.Application". I'd add the result of each computer into an array and then use the ComObject to add the content to a new sheet. You can read more here:
http://blogs.technet.com/b/heyscriptingguy/archive/2013/04/03/excel-spreadsheets.aspx
tompa
http://tompaps.blogspot.com
Similar Messages
-
How to get XML format output from Hyperion Financial Reporting
Dears,
We are using Hyperion Financial Reporting to replace FSG in fusion. I found that Hyperion FR report can be exported to html/excel/pdf format. However, I would like the report to export to xml format.It means I only need the xml data source.
Anyone who knows how to get the xml format output from Hyperion FR, is there any avaiable API?I think if you export the report, you will be able to open the .des file in Notepad/Wordpad and see xml content.
-
Formatting Output from a procedure
Hi all,
I want to format the output of this procedure
declare
cursor c1 is select tname from tab where tabtype = 'TABLE' ;
tabname varchar2(1000) ;
i number := 1;
rc number ;
str varchar2(1000) ;
begin
open c1 ;
loop
fetch c1 into tabname ;
exit when c1%notfound ;
str := 'select count(*) from ' || tabname ;
execute immediate str into rc ;
dbms_output.put_line(i || ' - ' || tabname || ' -- ' ||rc) ;
i := i + 1 ;
end loop ;
close c1 ;
end ;
The OUTPUT is like this.......
1 - asdf -- 0
2 - asdfsdafasdf -- 16
3 - asdfsaf -- 327
4 - asdfasdfasfsdafsdfs -- 27
5 - asd -- 128562
Now, I want this output should be like this
1 - asdf -- 0
2 - asdfsdafasdf -- 16
3 - asdfsaf -- 327
4 - asdfasdfasfsdafsdfs -- 27
5 - asd -- 128562
Thanks in advance,
PalUse [ pre ] and [ /pre ] with no sapce.
http://www.oracle.com/technology/forums/faq.html#q14
But,for your question, using to_char or lpad, you can format.
dbms_output.put_line(i || ' - ' || tabname || ' -- ' ||lpad(rc,20)) ;
-- Oops, I correct as following.
dbms_output.put_line(rpad(i || ' - ' || tabname || ' -- ' ,60)||lpad(rc,20)) ;
Message was edited by:
ushitaki -
NEED HELP:reading output from ms-dos program (with exec)
I'm trying to execute an ms-dos program using exec,
and reading it's output.
the program is running ,but, I can't see it's output.
I've tried many variations of this code:
Process p = Runtime.getRuntime().exec("file_name");
try { p.waitFor();}
catch(Exception e) {}
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while((line = input.readLine()) != null )
please help mewith this - thanks, froy
System.out.println(line);
System.out.println(p.exitValue());try { p.waitFor();}This doesn't return until the exec process has finished running. So there is no stream for it to get anything from.
-
Formatting output from a select statement?
Hi: a trivial question.
When I run a select on four fields, it prints the first field in one line and the rest in the second line.
TYPE
PROTO CLASS_ID DSTPORT
BUILT_INBOUND_UDP
17 50007 53
Is there a any variable I can configure so that all four fields are printed in the same line?
TYPE PROTO CLASS_ID DSTPORT
BUILT_INBOUND_UDP 17 50007 53Thanks
RaySQL> SELECT a.owner from all_all_tables a WHERE rownum = 1;
OWNER
SYS
SQL> column owner format a15;
SQL> SELECT a.owner from all_all_tables a WHERE rownum = 1;
OWNER
SYS
SQL> column owner format a5;
SQL> SELECT a.owner from all_all_tables a WHERE rownum = 1;
OWNER
SYS
SQL> -
Formatting output from psbase.InvokeGet
I can run the following script to get each user's name, FQDN's and RDS (Terminal Services) path. If I pipe the script to an OutFile when I run it, I get a text file with these elements listed on separate lines. If I break it into two scripts
with one getting display name and RDS profile and the other getting FQDN and RDS profile, I can work through the 2 output files with Word and Excel to get a spreadsheet of all 3 elements, but I would much rather not have to go through the added hassle since
we will be checking this somewhat frequently in the near future.
What can I do to the script below to have it output all 3 elements of each userID in a table? If not in a table, then a text file with the elements separated by semicolons (doesn't have to be semicolons, but it can't be commas since the FQDN is full
of commas) and each user's info on a separate line so that I can easily bring it into Excel?
The script is:
$Users = ([ADSISearcher]"(&(objectCategory=person)(objectClass=user))").findall() | select path
foreach ($user in $users) {
$userSearch = [adsi]"$($user.path)"
$userSearch.psbase.InvokeGet(“displayname”)
$userSearch.psbase.InvokeGet(“distinguishedname”)
$userSearch.psbase.InvokeGet(“terminalservicesprofilepath”)
Thank you for your help with this.Hi Logan,
Give this a try:
$out = @()
$Users = ([ADSISearcher]"(&(objectCategory=person)(objectClass=user))").findall() | select path
foreach ($user in $users) {
$userSearch = [adsi]"$($user.path)"
try { $rdsPath = $userSearch.psbase.InvokeGet(“terminalservicesprofilepath”) }
catch { $rdsPath = '' }
$props = @{
DisplayName = $userSearch.psbase.InvokeGet(“displayname”)
DN = $userSearch.psbase.InvokeGet(“distinguishedname”)
RDSPath = $rdsPath
$out += New-Object PsObject -Property $props
$out | Export-Csv .\userInfo.csv -NoTypeInformation
Don't retire TechNet! -
(Don't give up yet - 12,700+ strong and growing) -
[Forum FAQ] How to format and combine PowerShell outputs
Format the output with “Format-Table” and “Format-list”
Sometimes when we query Powershell cmdlet, we would get ellipses in the result, which is not desirable.
In this scenario, we can use the cmdlet “Format-Table” and “Format-list” to view the entire output:
Get-Service | where{$_.name -like "BrokerInfrastr*"}
Get-Service | where{$_.name -like "BrokerInfrastr*"}|Format-Table –AutoSize
Get-Service | where{$_.name -like "BrokerInfrastr*"}|Format-list
Figure 1: format powershell output
Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.Thanks, this has been helpful. I have been trying to figure out how the PSObjects work.
I created a function that takes an object and creates a function to create PSObjects
Function Get-ObjectPropertiesFunction
[CmdletBinding()]
[OutputType([string])]
param
[Parameter(Mandatory=$true,
ValueFromPipeline=$false,
ValueFromPipelineByPropertyName=$false,
ValueFromRemainingArguments=$false,
Position=0,
ParameterSetName='Object')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[Object]$Object
Begin
$Members=Get-Member -InputObject $Object
$ValidPropertyType = @{"{get;set;}"=$True;"{get;}"=$True;}
$ValidReturnType = @{"bool"=$True;"byte"=$True;"string"=$True;"string[]"=$True;
"int"=$True;"int16"=$True;"int32"=$True;"int64"=$True;
"uint"=$True;"uint16"=$True;"uint32"=$True;"uint64"=$True;
[string]$String=""
$String=$String+"Function Get-PSObjectPropertiesFromObject `n"
$String=$String+"{ `n"
$String=$String+" [CmdletBinding()] `n"
$String=$String+" [OutputType([PSObject[]])] `n"
$String=$String+" param `n"
$String=$String+" ( `n"
$String=$String+" [Parameter(Mandatory="+"$"+"true, `n"
$String=$String+" ValueFromPipeline="+"$"+"false, `n"
$String=$String+" ValueFromPipelineByPropertyName="+"$"+"false, `n"
$String=$String+" ValueFromRemainingArguments="+"$"+"false, `n"
$String=$String+" Position=0, `n"
$String=$String+" ParameterSetName='Object')] `n"
$String=$String+" [ValidateNotNull()] `n"
$String=$String+" [ValidateNotNullOrEmpty()] `n"
$String=$String+" [Object]"+"$"+"Object `n"
$String=$String+" ) `n"
$String=$String+" Begin `n"
$String=$String+" { `n"
$String=$String+" $"+"Output = New-Object PSObject -Property ([Ordered]@{ `n"
ForEach ($Member in $Members)
IF ($Member.MemberType -EQ "Property")
[string]$Name=$Member.Name
IF ($Name.Substring(1,1) -NE "_")
[String[]]$Definition=$Member.Definition.Split(" ")
[string]$PropertyType=$Definition[2]
IF ($ValidPropertyType[$PropertyType])
$ReturnType=$Definition[0]
if ($ValidReturnType[$ReturnType])
$String=$String+" $Name="+"$"+"Object.$Name `n"
$String=$String+" }) `n"
$String=$String+" $"+"Output `n"
$String=$String+" } `n"
$String=$String+"} `n"
$String
Here is the output from the above function for the WIN32_BootConfiguration class (Small Class)
$Class="Win32_BootConfiguration"
$Function=Get-ObjectPropertiesFunction (Get-WMIObject -Class $Class)
PS C:\>> $Function
Function Get-PSObjectPropertiesFromObject
[CmdletBinding()]
[OutputType([PSObject[]])]
param
[Parameter(Mandatory=$true,
ValueFromPipeline=$false,
ValueFromPipelineByPropertyName=$false,
ValueFromRemainingArguments=$false,
Position=0,
ParameterSetName='Object')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[Object]$Object
Begin
$Output = New-Object PSObject -Property ([Ordered]@{
BootDirectory=$Object.BootDirectory
Caption=$Object.Caption
ConfigurationPath=$Object.ConfigurationPath
Description=$Object.Description
LastDrive=$Object.LastDrive
Name=$Object.Name
ScratchDirectory=$Object.ScratchDirectory
SettingID=$Object.SettingID
TempDirectory=$Object.TempDirectory
$Output
PS C:\>>
The function also works for other and more interesting classes like SQL Server.
PS C:\>>
$srv = New-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database($srv, "AdventureWorks2012")
$Function=Get-ObjectPropertiesFunction $db
$Function
Function Get-PSObjectPropertiesFromObject
[CmdletBinding()]
[OutputType([PSObject[]])]
param
[Parameter(Mandatory=$true,
ValueFromPipeline=$false,
ValueFromPipelineByPropertyName=$false,
ValueFromRemainingArguments=$false,
Position=0,
ParameterSetName='Object')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[Object]$Object
Begin
$Output = New-Object PSObject -Property ([Ordered]@{
ActiveConnections=$Object.ActiveConnections
AnsiNullDefault=$Object.AnsiNullDefault
AnsiNullsEnabled=$Object.AnsiNullsEnabled
AnsiPaddingEnabled=$Object.AnsiPaddingEnabled
AnsiWarningsEnabled=$Object.AnsiWarningsEnabled
ArithmeticAbortEnabled=$Object.ArithmeticAbortEnabled
AutoClose=$Object.AutoClose
AutoCreateStatisticsEnabled=$Object.AutoCreateStatisticsEnabled
AutoShrink=$Object.AutoShrink
AutoUpdateStatisticsAsync=$Object.AutoUpdateStatisticsAsync
AutoUpdateStatisticsEnabled=$Object.AutoUpdateStatisticsEnabled
AvailabilityGroupName=$Object.AvailabilityGroupName
BrokerEnabled=$Object.BrokerEnabled
CaseSensitive=$Object.CaseSensitive
ChangeTrackingAutoCleanUp=$Object.ChangeTrackingAutoCleanUp
ChangeTrackingEnabled=$Object.ChangeTrackingEnabled
ChangeTrackingRetentionPeriod=$Object.ChangeTrackingRetentionPeriod
CloseCursorsOnCommitEnabled=$Object.CloseCursorsOnCommitEnabled
Collation=$Object.Collation
ConcatenateNullYieldsNull=$Object.ConcatenateNullYieldsNull
DatabaseOwnershipChaining=$Object.DatabaseOwnershipChaining
DatabaseSnapshotBaseName=$Object.DatabaseSnapshotBaseName
DateCorrelationOptimization=$Object.DateCorrelationOptimization
DboLogin=$Object.DboLogin
DefaultFileGroup=$Object.DefaultFileGroup
DefaultFileStreamFileGroup=$Object.DefaultFileStreamFileGroup
DefaultFullTextCatalog=$Object.DefaultFullTextCatalog
DefaultSchema=$Object.DefaultSchema
EncryptionEnabled=$Object.EncryptionEnabled
FilestreamDirectoryName=$Object.FilestreamDirectoryName
HonorBrokerPriority=$Object.HonorBrokerPriority
ID=$Object.ID
IsAccessible=$Object.IsAccessible
IsDatabaseSnapshot=$Object.IsDatabaseSnapshot
IsDatabaseSnapshotBase=$Object.IsDatabaseSnapshotBase
IsDbAccessAdmin=$Object.IsDbAccessAdmin
IsDbBackupOperator=$Object.IsDbBackupOperator
IsDbDatareader=$Object.IsDbDatareader
IsDbDatawriter=$Object.IsDbDatawriter
IsDbDdlAdmin=$Object.IsDbDdlAdmin
IsDbDenyDatareader=$Object.IsDbDenyDatareader
IsDbDenyDatawriter=$Object.IsDbDenyDatawriter
IsDbManager=$Object.IsDbManager
IsDbOwner=$Object.IsDbOwner
IsDbSecurityAdmin=$Object.IsDbSecurityAdmin
IsDesignMode=$Object.IsDesignMode
IsFederationMember=$Object.IsFederationMember
IsFullTextEnabled=$Object.IsFullTextEnabled
IsLoginManager=$Object.IsLoginManager
IsMailHost=$Object.IsMailHost
IsManagementDataWarehouse=$Object.IsManagementDataWarehouse
IsMirroringEnabled=$Object.IsMirroringEnabled
IsParameterizationForced=$Object.IsParameterizationForced
IsReadCommittedSnapshotOn=$Object.IsReadCommittedSnapshotOn
IsSystemObject=$Object.IsSystemObject
IsUpdateable=$Object.IsUpdateable
IsVarDecimalStorageFormatEnabled=$Object.IsVarDecimalStorageFormatEnabled
LocalCursorsDefault=$Object.LocalCursorsDefault
MirroringPartner=$Object.MirroringPartner
MirroringPartnerInstance=$Object.MirroringPartnerInstance
MirroringRedoQueueMaxSize=$Object.MirroringRedoQueueMaxSize
MirroringRoleSequence=$Object.MirroringRoleSequence
MirroringSafetySequence=$Object.MirroringSafetySequence
MirroringTimeout=$Object.MirroringTimeout
MirroringWitness=$Object.MirroringWitness
Name=$Object.Name
NestedTriggersEnabled=$Object.NestedTriggersEnabled
NumericRoundAbortEnabled=$Object.NumericRoundAbortEnabled
Owner=$Object.Owner
PrimaryFilePath=$Object.PrimaryFilePath
QuotedIdentifiersEnabled=$Object.QuotedIdentifiersEnabled
ReadOnly=$Object.ReadOnly
RecursiveTriggersEnabled=$Object.RecursiveTriggersEnabled
TargetRecoveryTime=$Object.TargetRecoveryTime
TransformNoiseWords=$Object.TransformNoiseWords
Trustworthy=$Object.Trustworthy
TwoDigitYearCutoff=$Object.TwoDigitYearCutoff
UserName=$Object.UserName
Version=$Object.Version
$Output
PS C:\>> -
Need formatted EXCEL output, from View Output,Oracle Applications
To view the report(Normal RDF report,not XML Publisher Report) output in EXCEL, I changed the Profile Options.
From: System Administrator Responsibility.
Navigation: Install -> Viewer Options.
Added the below entry.
PDF application/vnd.ms-excel Microsoft Excel
Now when I submit the report, after completing, when clicked to View Output, I can see the list showing Browser and Microsoft Excel.
I saved the Excel Sheet,but its not formatted. How do I get the formatted Output. As columns are not in proper shape.
Please do the needful.
Thanks.Hi Abdul;
Please check below thread's mention metalink note&advice:
Open Text output of a Report in Excel - Bad format
Re: Open Text output of a Report in Excel - Bad format
Hope it helps
Regard
Helios -
In Below Script I am able to get "disksizerequired" number in red by below script but I want that whole Cell to be red.
Please let me know how to do it
# HTML code to format output
$b = "<style>"
$b = $b + "BODY{background-color:white;}"
$b = $b + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$b = $b + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}"
$b = $b + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;}"
$b = $b + "</style>"
# Variable initializing to send mail
$TXTFile = "C:\Abhishek\test\test231.html"
$SMTPServer = "mapintmail.lab.com"
$emailFrom = "[email protected]"
$emailTo = "[email protected]"
$subject = "Sharepoint Farms Content databases Report"
$emailBody = "Dailyreport on Sharepoint Farms Content databases"
$encrypted ="01000000d08c9ddf0115d1118c7a00c04fc297eb0100000097606a1d1a7321488a23f2056c613f690000000002000000000003660000c000000010000000ebf48a9bd08c88a4de367597a1b86b390000000004800000a0000000100000006fa6c5ca0af8ad180e19cc6e5a42765e200000009a2551a74c5da425a1fa63705d1d7469fa0bb94409bf9a43ba951ee5c64d7ff614000000c9c659511fda53078b9f2e00f3b673349962affa"
$usser1 = "lab\abhi"
$usser2 = "labb\abhi"
$password = ConvertTo-SecureString -string $encrypted
$cred1 = new-object -typename System.Management.Automation.PSCredential -argumentlist $usser1,$password
$cred2 = new-object -typename System.Management.Automation.PSCredential -argumentlist $usser2,$password
# Creating PSSession and Loading Snapin
$s1 = New-PSSession -Authentication CredSSP -Credential $cred1 -ComputerName LROSHRPTL01
$s2 = New-PSSession -Authentication CredSSP -Credential $cred2 -ComputerName LROSHRPTL03
Invoke-Command -Session $s1 -ScriptBlock {Add-PSSnapin Microsoft.SharePoint.PowerShell}
$f1 = Invoke-Command -Session $s1 -ScriptBlock {Get-SPWebApplication | Get-SPContentDatabase}
$g1 = $f1 | Select-Object DisplayName,WebApplication,disksizerequired,CurrentSiteCount,WarningSiteCount,MaximumSiteCount | ConvertTo-Html -Fragment DisplayName,WebApplication,CurrentSiteCount,WarningSiteCount,MaximumSiteCount,@{label="disksizerequired";expression={
if($_.disksizerequired -gt 1024*1204*1024)
{"#font"+$_.disksizerequired+"font#"}
else
{$_.disksizerequired}
$g1 = $g1 -replace "#font","<font color='red'>"
$g1 = $g1 -replace "font#","</font>"
Invoke-Command -Session $s2 -ScriptBlock {Add-PSSnapin Microsoft.SharePoint.PowerShell}
$f2 = Invoke-Command -Session $s2 -ScriptBlock {Get-SPWebApplication | Get-SPContentDatabase}
$g2 = $f2 | Select-Object DisplayName,WebApplication,disksizerequired,CurrentSiteCount,WarningSiteCount,MaximumSiteCount | ConvertTo-Html -Fragment DisplayName,WebApplication,CurrentSiteCount,WarningSiteCount,MaximumSiteCount,@{label="disksizerequired";expression={
if($_.disksizerequired -gt 1024*1024*1024)
{"#font"+$_.disksizerequired+"font#"}
else
{$_.disksizerequired}
$g2 = $g2 -replace "#font","<font color='red'>"
$g2 = $g2 -replace "font#","</font>"
ConvertTo-HTML -head $b -Body "<h1>$(Get-Date) Sharepoint Farm Database Content DB Report</h1> <br /> <h2>SharePoint_Config_UAT2010 $g1 SharePoint_Config_Intranet2010 $g2</h2>" | Out-File C:\Abhishek\test\test231.html
Invoke-Expression C:\Abhishek\test\test231.html
# Code to Send Mail
Send-MailMessage -SmtpServer $SMTPServer -From $emailFrom -To $emailTo -Subject $subject -Body $emailBody -Attachment $TXTFileIf I understand the script correctly, what it will be doing at the moment is setting the font colour to red, instead of the background colour. To do this, you'd normally have to sent the attribute on the <td bgcolor='red'>, rather than using <font
color='red'>, but you might try using a span instead.
$g2 = $g2 -replace "#font","<span style='background-color:red;'>"
$g2 = $g2 -replace "font#","</span>"
If this isn't what you're looking for (because there may be an untidy margin around the span, or something), you'll need to give the <td> a classname, and then change the css for that class within $b instead. Let me know if you prefer to try that.
OWA For SmartPhone -
Inconsistent output from SCVMM PowerShell commands
I noticed that the output from SCVMM commands is not consistent. I will use an example: When I run the command Get-SCVMHostGroup for the first time, the Hosts and AllChildHosts properties are null, but if I keep running the same command continuously
the values slowly start appearing. See following output:
PS C:\Users\mandardi> Get-SCVMHostGroup
AllChildGroups : {}
AllChildHosts : {}
AllowUnencryptedTransfers : False
ChildGroups : {}
CreationDate : 8/16/2011 7:32:06 PM
Creator :
Description :
Hosts : {}
ID : 0e3ba228-a059-46be-aa41-2f5cf0f4b96e
InheritPROSettings :
InheritNetworkSettings : False
IsFullyCached : True
IsRoot : True
MarkedForDeletion : False
ModificationDate : 8/16/2011 7:32:06 PM
ModifiedBy :
Name : All Hosts
ParentHostGroup :
Path : All Hosts
PROAutomationLevel :
PROMonitoringLevel :
ServerConnection : Microsoft.SystemCenter.VirtualMachineManager.Remoting.ServerConnection
PS C:\Users\mandardi> Get-SCVMHostGroup
AllChildGroups : {}
AllChildHosts : {mandar-win2k8.cvlxxxxx.local}
AllowUnencryptedTransfers : False
ChildGroups : {}
CreationDate : 8/16/2011 7:32:06 PM
Creator :
Description :
Hosts : {mandar-win2k8.cvlxxxxx.local}
ID : 0e3ba228-a059-46be-aa41-2f5cf0f4b96e
InheritPROSettings :
InheritNetworkSettings : False
IsFullyCached : True
IsRoot : True
MarkedForDeletion : False
ModificationDate : 8/16/2011 7:32:06 PM
ModifiedBy :
Name : All Hosts
ParentHostGroup :
Path : All Hosts
PROAutomationLevel :
PROMonitoringLevel :
ServerConnection : Microsoft.SystemCenter.VirtualMachineManager.Remoting.ServerConnection
The command above was run twice within an interval of few seconds, as you can see the Hosts/AllChildHosts properties are populated after the second attempt.
I want to know what is the reason for this behavior, are the properties collected asynchronously? If yes, what is the best way to prevent this?
I also noticed that when you open a new powershell window, the same behavior repeats, in fact you get correct output in one window, whereas you get null values in other. What is the reason for this and what's the work around?
Thanks in advance.
MandarThere are times when you get a job back as the return value and not the actual queried value.
Quite frequently it has to do with the information being queried.
Getting a specific HostGroup I would expect to be relatively quick, however generically querying for all host groups might not.
I have not tried the specific scenario myself, I am describing behavior i have experienced.
Does this affect the reliability of the PoSh module? I don't think so. But it definately affects how you use it and its cmdlets.
I have learned that taking thinking from another virutalization environment (XenServer or vCenter for example) and expecting those same behaviors from SCVMM is a false assumption that many folks run in to. This makes VMM neither fit nor unfit - just
different.
I am not attempting to defend VMM, just stating situations that I have been in with development teams.
Brian Ehlert (hopefully you have found this useful) http://ITProctology.blogspot.com
Learn. Apply. Repeat. -
I am not getting any output from the speakers of the ipad. However the sound is ok if i use headphones. Can anyone help?
1. Check the Side Switch
http://i1224.photobucket.com/albums/ee374/Diavonex/00bf6eae.jpg
2. Double-click the Home button and swipe to the right and check volume control
http://i1224.photobucket.com/albums/ee374/Diavonex/ea5b842d.jpg
3. Settings>Notification>Game Center>Sound>ON
http://i1224.photobucket.com/albums/ee374/Diavonex/67a15edf.jpg -
I keep losing volume output from one of the Tracks from my Song Project. The Strings volume, at first, was there but, when I sent the Song to my iTunes Library the strings volume was absent. Can any help? I've experience this before on another project, where for some unknown reason I've lost the Orchestral Choir volume. Sometimes, if the volume on a track disappears, I close everything down & then restart-this temporarily sorts it out but losing a track in the final mix is a different problem...please help!
Many thanks!!soulkiss wrote:
I need the vocals to be the same volume throughout.
a good tool for that would be one of the compressors (a web search on "audio mixing compressor" will yield tons of information on using them)
soulkiss wrote:
It always exports at the audio level no matter what.
http://www.bulletsandbones.com/GB/GBFAQ.html#tooloud
(Let the page FULLY load. The link to your answer is at the top of your screen) -
i am trying to display the output from my ipod touch on apple tv. i can get the audio but no video. Thank you for any advice.
What output are you trying to get to your tv?
-
Can anyone help me understand this output from Console?
My Macbook Pro freezes and I have to manually shut it down and restart it. This is the error output from Console after I restart the Mac and find the time that the Mac froze.
Here is the error code again, if it was too hard to read from the image above:Hi, did you find any answer to this? I have the same problem with globeinvestor.com gold tracker program. It stops to run from very beginning and give me a 23 code error.
Their supprot can not fix this. Actually i have tried this in three different computers and all of them are same. -
I'm looking for some help with my script that I have.
The process in how it works is as follows,
1. Gather all computer objects within a domain (dnshostname)
2. Ping test to see which ones are up and active.
3. For each active computer
3.1 Print the hostname
3.2 query the objects Sid,sAMAccountName, etc information
3.3 Print the output from Get-LocalAcctInfo into a text file.
4. Repeat
Here's the code I'm using, I know it's not perfect but it's a work in progress.
function Get-LocalAcctInfo {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
$ComputerName
Process {
Foreach ($Computer in $ComputerName) {
Try {
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$PrincipalContext = New-Object System.DirectoryServices.AccountManagement.PrincipalContext([System.DirectoryServices.AccountManagement.ContextType]::Machine, $Computer)
$UserPrincipal = New-Object System.DirectoryServices.AccountManagement.UserPrincipal($PrincipalContext)
$Searcher = New-Object System.DirectoryServices.AccountManagement.PrincipalSearcher
$Searcher.QueryFilter = $UserPrincipal
$computer
$Searcher.FindAll() | Format-List -Property Sid,SamAccountName,Enabled,LastPasswordSet,PasswordNotRequired,PasswordNeverExpires,UserCannotChangePassword
Catch {
Write-Warning -Message "$($_.Exception.Message)"
$rtn = $null
$count = 0
Get-ADComputer -Filter * |
ForEach-Object {
if((Test-Connection -CN $_.dnshostname -Count 1 -Buffersize 16 -quiet) -match 'True')
write-host -ForegroundColor green $_.dnshostname
Get-LocalAcctInfo $_.dnshostname | Out-File C:\Users\UserAccount\Desktop\results.txt -append
$count = $count + 1
else
write-host -ForegroundColor red $_.dnshostname
write-host $count " hosts are active and were enumerated on the domain."
What I'm trying to accomplish is to have the computer name along with the account information formatted nicely within a csv file.
I have working code that is able to place all the information about the computer object within a csv when I use the following within my function and code.
$Searcher.FindAll() | Where-Object {$_.Sid -Like "*-*"}
Get-SWLocalAdmin $_.dnshostname | Export-Csv C:\Users\adsecure_rstrong\Desktop\text.csv
The output of the code that I pasted in the code block above is the following
"computername.domain.com
Sid : S-1-5-21-1213413474-1213434134760-84413413436-500
SamAccountName : Administrator
Enabled : True
LastPasswordSet : 1/1/2014 8:27:20 PM
PasswordNotRequired : False
PasswordNeverExpires : False
UserCannotChangePassword : False"
I'd like the computername to be placed with the rest of the output and in csv format
Any suggestions or recommendations are welcome. I'm new to Powershell and learning/teaching myself along the way. Note, that my original code works but I'd rather put it into a csv file so I can easily filter out different columns.
Thanks,
Rob.We have all the information on domain accounts regarding password last set, password doesn't expire etc.
We're looking to check for each computer that exists within the AD domain, what LOCAL user accounts exist on those devices and the information surrounding them.
The Get-ADComputer line just gives me the computers that exist within the domain, so that I can feed that information into my function and pull out the local user information.
Here's an example of my local user account output in a nicer format.
Sid SamAccountName Enabled LastPasswordSet
S-1-5-21-277684375-1707151907-12... Administrator True 12/4/2008 8:20:54 PM
S-1-5-21-277684375-1707151907-12... User1 True 5/28/2010 6:02:54 PM
S-1-5-21-277684375-1707151907-12... User2 True 5/28/2010 6:04:58 PM
S-1-5-21-277684375-1707151907-12... User3 True 5/28/2010 6:11:59 PM
S-1-5-21-277684375-1707151907-12... Guest False 3/20/2014 7:30:24 PM
S-1-5-21-277684375-1707151907-12... IUSRTESTUSER True 7/28/2010 1:47:45 PM
S-1-5-21-277684375-1707151907-12... IUSRWEBUSER True 5/2/2013 7:11:03 PM
S-1-5-21-277684375-1707151907-12... SUPPORT_388945a0 False 12/5/2008 1:26:33 AM
S-1-5-21-277684375-1707151907-12... ServiceAccountUser1 True 5/28/2010 6:06:36 PM
Hope this explains it a little better.
I'll try out your suggestions and see if I can get anywhere further.
Maybe you are looking for
-
Certain apps won't update or download on any device.
I've searched for two weeks to no avail. I've seen similar problems posted but nothing quite like this. I have an iPhone 5s iOS 8.2, a 4th Gen iPad iOS 8.2 and Mac Mini Late 2014 OS X Yosemite 10.10.2. It all started with wanted to download the Pages
-
Amount split in MIRO without tax amount
Hi All, I had posted this in different thread and felt its better to open separate thread instead. I am facing a problem to use amount split on net amount instead on gross amount so that taxes can be paid in first installment. Situation is as below E
-
Adobe Updater 9.3.2 Admin Rights
Hi, Simple question really. The updater feature in adobe reader 9.3.2, does a user need to have administrative rights to use the "Automatically Install Updates" option. ive installed it for a test user without admin rights and it has the entire upd
-
Exporting PDF format for web viewing, fonts look bad
Hey everybody I'm relatively new to indesign so sorry if this is a simple one. I'm doing a newsletter in indesign, which will be used stricktly for web viewing. Whenever I export the file as a pdf the body text fonts look a bit off, as though they ar
-
Mac OS X Tiger 10.4.11 Deleted folders/files when logged in as root user. (don't ask!) On restart , wont boot up , get grey screen with white apple logo the black screen with command line: localhost:/ root# Started up from install cd - repaired permi