Hello All, I am looking for a powershell script to find out all computers in a network which have Oracle Database installed. Is there a script I can use or twaek ? If yes please let me know. Thanks
Faiz
This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.
We actually expect you to make an own attempt at the first place to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.
There are more than enough examples out there on how to create a software inventory with PowerShell. Please use your favorite internet search enginge to find examples you can adapt to your particular needs.
I have been trying to use this script but its failing with errors. any suggestions ?
$Computers = Get-ADComputer -Filter *
Invoke-Command -ComputerName $Computers.Name -ScriptBlock {
Get-Package -Name “oracle”
}
When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Thanks in advance
How to format code in PowerShell.org <---- Click
Share the complete error message formatted as code please.
$Computers = Get-ADComputer -Filter *
Invoke-Command -ComputerName $Computers.Name -ScriptBlock {
Get-Package -Name "*oracle*"
}
-----------------------------------
Error I am getting is shown below, I have used Test-WSMan and it seems to return the status fine.
----------------------------------
[TTTTOO2] Connecting to remote server TTTTOO2 failed with the following error message : The client cannot connect to the
destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the
logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is
the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For
more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (TTTTOO2:String) [], PSRemotingTransportException
+ FullyQualifiedErrorId : CannotConnect,PSSessionStateBroken
?? what does that mean? Can you connect to the remote computer?
yes I can connect to the remote servers manually but not thru this code.
?? by PowerShell remoting or what? How do you do that?
Please keep in mind - we cannot see your screen and we cannot read your mind.
What exactly did you do with what computer to check if you can connect from your local computer to a remote computer?
And since you used
How many computers do you have in your array $Computers
? Do you get more than one error message?
The issue is coming only if I invoke the command from a powershell console in a server and
yes we use a thrid party tool to connect remotely to our servers. I get the same error multiple times for all the servers that are retrived by $Computers
You’re not answering my questions.
Or more exactly how did you check that ayou can connect from the computer you’re running this code on to a remote computer you’re trying to query?
Olaf, did you catch this from his post?
There are about 100 servers in our network and I used Test-WSMan to check connectivity to remote servers
So you can use for example
Enter-PSSession -ComputerName 'TTTTOO2'
to connect successfully to the target computer in your question or any other computer you want to query?
No I am unable to connect using Enter-PSSession
I get the following error
Enter-PSSession : Connecting to remote server TTTTOO2 failed with the following error message : Access is denied. For more
information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -ComputerName 'TTTTOO2'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (TTTTOO2:String) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed
… and that’s your issue … please read the following help topic COMPLETELY to learn how to enable remoting.