Search found 163 matches

by ITEngineer
Thu Feb 28, 2019 4:44 am
Forum: Windows PowerShell
Topic: Exporting Exchange server mailbox information as .CSV so I can import.CSV as Mail-Contact?
Replies: 1
Views: 815

Exporting Exchange server mailbox information as .CSV so I can import.CSV as Mail-Contact?

People, I need to export the sister company Exchange Server mailbox attributes as .CSV, So I can run it on the new Exchange Server OnPremise using the script below: Import-Csv "C:\contacts.csv" | foreach {Set-Contact $_.externalemailaddress -Name $_.name -FirstName $_.firstname -LastName $_.lastname...
by ITEngineer
Mon Feb 18, 2019 2:59 pm
Forum: Windows PowerShell
Topic: Query OnPremise AD for Specific AD attributes not working?
Replies: 1
Views: 562

Query OnPremise AD for Specific AD attributes not working?

Hi People, I need some help to modify the below script to show additional column Office 365 or OnPremise: Get-ADGroup -Filter {Name -like '*IT*'} | Select-Object @{ n='Group'; e={ $_.Name } }, @{ n='Members'; e={ (Get-ADGroup $_.DistinguishedName -Properties Members | Select-Object Members).Members ...
by ITEngineer
Sun Feb 10, 2019 4:56 pm
Forum: Windows PowerShell
Topic: Invoke-Command not working for executing another script using UNCPath?
Replies: 3
Views: 1004

Re: Invoke-Command not working for executing another script using UNCPath?

jvierra wrote:
Fri Feb 08, 2019 12:24 am
"Second hop restriction" You cannot access a third computer from a remote session.
OK, so how to make it working?
by ITEngineer
Thu Feb 07, 2019 11:27 pm
Forum: Windows PowerShell
Topic: Invoke-Command not working for executing another script using UNCPath?
Replies: 3
Views: 1004

Invoke-Command not working for executing another script using UNCPath?

Hi All People, I need some help to execute the Batch script remotely using Invoke-Command but still failed numerous times. I have executed the PowerShell ISE from my local workstation as Administrator and my user account is the member of Enterprise Administrator and Domain Admins group. When I try t...
by ITEngineer
Thu Feb 07, 2019 4:23 pm
Forum: Windows PowerShell
Topic: Unable to export the result to .CSV file ?
Replies: 3
Views: 792

Re: Unable to export the result to .CSV file ?

$CsvFile = 'C:\Result.csv' $key = 'SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install' $OUList = @( 'OU=TEST Servers,OU=MyDomain Testing,DC=MyDomain,DC=com' 'OU=PROD Servers,OU=Servers,OU=MyDomain Sydney,DC=MyDomain,DC=com' 'OU=PROD Servers,OU=Servers,OU=New Company...
by ITEngineer
Mon Feb 04, 2019 5:20 pm
Forum: Windows PowerShell
Topic: Unable to export the result to .CSV file ?
Replies: 3
Views: 792

Unable to export the result to .CSV file ?

People, I'm trying to the list of the installed update like the below result into .CSV like running the Get-HotFix manually one by one for each server: ServerName, Last Time Update Installed, KB Number, KB Update Name, InstalledBy PRODDB01, 31/12/2018 02:46:55, KB4462930, Cumulative Update, NT AUTHO...
by ITEngineer
Tue Jan 22, 2019 5:21 pm
Forum: Windows PowerShell
Topic: Get-WmiObject : Out of memory error?
Replies: 4
Views: 938

Re: Get-WmiObject : Out of memory error?

jvierra wrote:
Tue Jan 22, 2019 9:36 am
The first thig to do is to reboot the problem server and test again.

Get-Service uses WMI so it may also fail.
I can't reboot it now since it is Critical production server. Is there any service that I can restart?

What about using the Get-CimInstance?
by ITEngineer
Tue Jan 22, 2019 5:10 am
Forum: Windows PowerShell
Topic: Get-WmiObject : Out of memory error?
Replies: 4
Views: 938

Re: Get-WmiObject : Out of memory error?

jvierra wrote:
Tue Jan 22, 2019 4:49 am
It appears that you have WMI issues. The scripts are correct.
So how to fix that issue or change it into Get-Service instead?
by ITEngineer
Tue Jan 22, 2019 4:23 am
Forum: Windows PowerShell
Topic: Get-WmiObject : Out of memory error?
Replies: 4
Views: 938

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: 2270

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*" } ...