Search found 145 matches

by ITEngineer
Tue Jan 22, 2019 4:23 am
Forum: Windows PowerShell
Topic: Get-WmiObject : Out of memory error?
Replies: 4
Views: 794

Get-WmiObject : Out of memory error?

Hi All, I am trying to learn to script with WMI object & PowerShell, so I'm not sure why the simple script below does not work for the some server, but work for the other? $Server = 'PRDSQL17-VM' Get-WmiObject -ComputerName $Server -Class Win32_LogicalDisk -Filter "DriveType = 3" | ft -AutoSize Get-...
by ITEngineer
Thu Jan 10, 2019 10:09 pm
Forum: Windows PowerShell
Topic: PowerShell script to Get-RemotePrograms and export to .CSV for multiple AD computer object not working for bulk?
Replies: 12
Views: 1929

Re: PowerShell script to Get-RemotePrograms and export to .CSV for multiple AD computer object not working for bulk?

This would be easier to work with and debug. $OUList = @( 'OU=Workstations,OU=Testing,DC=Domain,DC=com', 'OU=Desktops,DC=Domain,DC=com', 'OU=Laptops,DC=Domain,DC=com' ) $computers = ForEach-Object{ Get-ADComputer -Properties Name -Filter { Enabled -eq $True -and OperatingSystem -like "*Windows*" } ...
by ITEngineer
Thu Jan 10, 2019 9:38 pm
Forum: Windows PowerShell
Topic: PowerShell script to Get-RemotePrograms and export to .CSV for multiple AD computer object not working for bulk?
Replies: 12
Views: 1929

Re: PowerShell script to Get-RemotePrograms and export to .CSV for multiple AD computer object not working for bulk?

What VS code? This is a script. Run it in PowerShell. I ran the code from the Gallery. It is a Jaap Brasser script. His scripts are very good always. It works fine for me. I suspect you changed the code somehow and now it is not working. Have you run it locally? Just type the name of the function. ...
by ITEngineer
Thu Jan 10, 2019 6:37 pm
Forum: Windows PowerShell
Topic: PowerShell script to Get-RemotePrograms and export to .CSV for multiple AD computer object not working for bulk?
Replies: 12
Views: 1929

Re: PowerShell script to Get-RemotePrograms and export to .CSV for multiple AD computer object not working for bulk?

You are trying to access a part of the registry that is forbidden. This is the full error line. Get-RemoteProgram : Exception calling "OpenRemoteBaseKey" with "2" argument(s): "Attempted to perform an unauthorized Is there anything that I need to do? because I have already run the Visual Studio Cod...
by ITEngineer
Thu Jan 10, 2019 5:54 pm
Forum: Windows PowerShell
Topic: PowerShell script to Get-RemotePrograms and export to .CSV for multiple AD computer object not working for bulk?
Replies: 12
Views: 1929

Re: PowerShell script to Get-RemotePrograms and export to .CSV for multiple AD computer object not working for bulk?

Look at the error message. It tells you exactly what the issue is: "Attempted to perform an unauthorized operation." What does it means? But when I run the script line by line manually, it works. :shock: The below lines is also working and returns the online PC that is ping-able: $OUList = @( "OU=W...
by ITEngineer
Thu Jan 10, 2019 5:22 pm
Forum: Windows PowerShell
Topic: PowerShell script to Get-RemotePrograms and export to .CSV for multiple AD computer object not working for bulk?
Replies: 12
Views: 1929

Re: PowerShell script to Get-RemotePrograms and export to .CSV for multiple AD computer object not working for bulk?

Here's the full script I run: Function Get-RemoteProgram { <# .Synopsis Generates a list of installed programs on a computer .DESCRIPTION This function generates a list by querying the registry and returning the installed programs of a local or remote computer. .NOTES Name : Get-RemoteProgram Author...
by ITEngineer
Thu Jan 10, 2019 5:20 pm
Forum: Windows PowerShell
Topic: PowerShell script to Get-RemotePrograms and export to .CSV for multiple AD computer object not working for bulk?
Replies: 12
Views: 1929

PowerShell script to Get-RemotePrograms and export to .CSV for multiple AD computer object not working for bulk?

Hi All, I need to export the .CSV for all computers with Microsoft Office installed, hence I've stumbled upon this script: https://gallery.technet.microsoft.com/Get-RemoteProgram-Get-list-de9fd2b4#content When I run the script using one line of code at the end of the file, it can give me the result ...
by ITEngineer
Wed Jan 09, 2019 11:02 pm
Forum: Windows PowerShell
Topic: Powershell for exporting Mailbox on Office 365 and OnPremise to each respective .CSV as the result?
Replies: 5
Views: 799

Re: Powershell for exporting Mailbox on Office 365 and OnPremise to each respective .CSV as the result?

jvierra wrote:
Wed Jan 09, 2019 9:12 pm
Connect to both services first but in the reverse order.
Yes, you are right, it works now :-)

Thanks
by ITEngineer
Wed Jan 09, 2019 8:45 pm
Forum: Windows PowerShell
Topic: Powershell for exporting Mailbox on Office 365 and OnPremise to each respective .CSV as the result?
Replies: 5
Views: 799

Re: Powershell for exporting Mailbox on Office 365 and OnPremise to each respective .CSV as the result?

When I execute this piece of codes in my PowerShell ISE on the laptop, it works and I can get the .CSV file: $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://PRDMAIL01-VM/PowerShell/ -Authentication Kerberos Import-PSSession $Session -AllowClobber # Exchange Serve...
by ITEngineer
Wed Jan 09, 2019 7:48 pm
Forum: Windows PowerShell
Topic: Powershell for exporting Mailbox on Office 365 and OnPremise to each respective .CSV as the result?
Replies: 5
Views: 799

Powershell for exporting Mailbox on Office 365 and OnPremise to each respective .CSV as the result?

Hi All, I wanted to get the exported.CSV list of the figure of mailboxes resides on-premise and Office 365 environments in each own.CSV Here's what I've come up with, but not working: Try { $UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri...