Search found 187 matches

by ITEngineer
Sun Sep 02, 2018 9:15 pm
Forum: Windows PowerShell
Topic: Need some help in formatting the Column export result to remove the SMTP: & smtp: ?
Replies: 3
Views: 847

Need some help in formatting the Column export result to remove the SMTP: & smtp: ?

Hi People, I need some help with the Replace string operation to make sure the result does not contain the SMTP: and smtp: string? The below script export the list of the Disabled AD account with their corresponding Exchange mailbox details: $filter = '(Enabled -eq $false) -and (homeMDB -ne "$null")...
by ITEngineer
Sun Sep 02, 2018 7:18 pm
Forum: Windows PowerShell
Topic: How to combine the PowerShell script to export list of Disabled AD user mailbox with Mailbox size column?
Replies: 2
Views: 828

Re: How to combine the PowerShell script to export list of Disabled AD user mailbox with Mailbox size column?

I can recommend posting in the Exchange forum to learn how to use the Exchange CmdLets and how to work with Shared mailboxes. You could also search for blog posts discussing how to work with shared mailboxes. Example: Get-Mailbox -RecipientTypeDetails SharedMailbox https://www.google.com/search?new...
by ITEngineer
Fri Aug 31, 2018 1:02 am
Forum: Windows PowerShell
Topic: How to combine the PowerShell script to export list of Disabled AD user mailbox with Mailbox size column?
Replies: 2
Views: 828

How to combine the PowerShell script to export list of Disabled AD user mailbox with Mailbox size column?

Hi People, I need someone to assist me in modifying the script below so it is showing all Disabled AD user account with Exchange User mailbox still enabled ( not Shared Mailbox )? Because the script below also returns Shared Mailboxes which is always created as disabled AD user account. $Allusers = ...
by ITEngineer
Tue Aug 28, 2018 11:37 pm
Forum: Windows PowerShell
Topic: Problem in executing PowerShell script as Scheduled Task & Run As Administrator
Replies: 5
Views: 1409

Re: Problem in executing PowerShell script as Scheduled Task & Run As Administrator

Why are you using PowerShell for a batch file? Just run the batch file. An exit code of 1 means that the execution failed. It is the other way around, The Backup report is 4000+ lines of PowerShell code which I have tried to encapsulate into the BATCH file for easy executable, but somehow it is sti...
by ITEngineer
Tue Aug 28, 2018 10:08 pm
Forum: Windows PowerShell
Topic: Problem in executing PowerShell script as Scheduled Task & Run As Administrator
Replies: 5
Views: 1409

Re: Problem in executing PowerShell script as Scheduled Task & Run As Administrator

Many batch scripts cannot be run outside of a UI session. They may need a full profile. Have you tried to manually create the task with the batch script? Hi Mr. Vierra, I have manually created the Scheduled task to call the .PS1 as per the MS Blog article above, but it is still failed to launch wit...
by ITEngineer
Tue Aug 28, 2018 8:11 pm
Forum: Windows PowerShell
Topic: Problem in executing PowerShell script as Scheduled Task & Run As Administrator
Replies: 5
Views: 1409

Problem in executing PowerShell script as Scheduled Task & Run As Administrator

I'm having the problem when trying to execute this Powershell as the Scheduled task. I have followed this steps: https://blogs.technet.microsoft.com/heyscriptingguy/2012/08/11/weekend-scripter-use-the-windows-task-scheduler-to-run-a-windows-powershell-script/ and use the following Argument : -Execut...
by ITEngineer
Wed Aug 22, 2018 10:27 pm
Forum: Windows PowerShell
Topic: Exchange PS Script to Export the Unused Distribution List in Exchange Server as .CSV?
Replies: 6
Views: 1301

Re: Exchange PS Script to Export the Unused Distribution List in Exchange Server as .CSV?

Your issue is very muddy. If you want empty groups then this is the method: [/code] $dist = (Get-DistributionGroup -Filter {Name -like "*IT*"} –ResultSize Unlimited | Where-Object { (Get-DistributionGroupMember –Identity $_.Name –ResultSize Unlimited).Count -eq 0} )[/code] Yes, that does make sense...
by ITEngineer
Wed Aug 22, 2018 5:10 pm
Forum: Windows PowerShell
Topic: Exchange PS Script to Export the Unused Distribution List in Exchange Server as .CSV?
Replies: 6
Views: 1301

Re: Exchange PS Script to Export the Unused Distribution List in Exchange Server as .CSV?

"Count" is an integer and not a string. Always remember that string numbers cannot normally be compare correctly. Hm.. no wonder it doesn't work. however, I've tried to modify the script to be like the following: $dist = (Get-DistributionGroup -Filter {Name -like "*IT*"} –ResultSize Unlimited | Whe...
by ITEngineer
Wed Aug 22, 2018 4:22 pm
Forum: Windows PowerShell
Topic: Exchange PS Script to Export the Unused Distribution List in Exchange Server as .CSV?
Replies: 6
Views: 1301

Re: Exchange PS Script to Export the Unused Distribution List in Exchange Server as .CSV?

Dwight, Thanks for the reply. However, the script that you've suggested somehow is not working as it should: $emptDLs = @() $DLs = Get-DistributionGroup $DLs | Foreach { $count = (Get-ADGroupMember -identity $_.Name).Count If ($count -gt "0") { Write-Host "DL $_.DisplayName is empty. Adding to list"...
by ITEngineer
Wed Aug 22, 2018 5:46 am
Forum: Windows PowerShell
Topic: Exchange PS Script to Export the Unused Distribution List in Exchange Server as .CSV?
Replies: 6
Views: 1301

Exchange PS Script to Export the Unused Distribution List in Exchange Server as .CSV?

Hi, Using PowerShell and Exchange 2013 remoting from my laptop, I need some help in fixing the below script to export the least used Distribution Group: $hts = Get-TransportService $dls = Get-DistributionGroup –ResultSize Unlimited $hts | ForEach-Object { Get-MessageTrackingLog -ResultSize Unlimited...