Powershell Exchange CU11 Pipe | - powershell

I have 4 Exchange 2013 servers on 2012R2.
3 servers are updated to CU11, last one is running CU10.
After the update to CU11 there are some piped commands I can't run on the servers that are updated to CU11, like this one:
Get-TransportService | Get-MessageTrackingLog -Recipients mail#mail.com
The error I get is this:
The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
+ CategoryInfo : InvalidArgument: (Exchangerservername:PSObject) [Get-MessageTrackingLog], ParameterBindingException
+ FullyQualifiedErrorId : InputObjectNotBound,Get-MessageTrackingLog
+ PSComputerName : xxxxxx
I have tried to write the command not copy.
Also tried to Set-ExecutionPolicy Unrestricted.
Powershell version is the same on all servers.

Easiest way around this is to use a foreach:
get-transportservice | foreach {get-messagetrackinglog -resultsize unlimited `
-start 05/21/2016 -recipient user#email.com}

I don't know if this is your issue but there are known Exchange Management Shell issues with CU11. https://jaapwesselius.com/2016/01/19/exchange-2013-cumulative-update-11-install-it-or-not/ Here is a link.

Related

Just trying to get a list of users assigned a specific MS licence using PowerShell

I am a bit of a novice where PowerShell is concerned. I do lots of things in ti, but generally have to look them up.
I am trying to get a list of users who have been assigned a specific licence in Office 365. I am using a command which I have used before successfully, but this time it will not work and keeps giving me the following error;
Get-MsolUser : The request channel timed out while waiting for a
reply after 00:00:59.9152154. Increase the timeout value passed to the
call to Request or increase the SendTimeout value on the Binding. The
time allotted to this operation may have been a portion of a longer
timeout. At line:1 char:1
+ Get-MsolUser | Where-Object {($_.licenses).AccountSkuId -match "excha ...
+ ~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Get-MsolUser], TimeoutException
+ FullyQualifiedErrorId : System.TimeoutException,Microsoft.Online.Administration.Automation.GetUser
The command I am using is;
Get-MsolUser | Where-Object {($_.licenses).AccountSkuId -match "exchangestandard"}
Is there a way if increasing the timeout? Or is there another way of getting this information, other than doing it manually. The company only has about 500 users and this particular licence is only being used by 42.
Thank you.

PowerShell DSC: The data source could not process the filter

Afternoon!
I have run into an issue with PowerShell DSC (the Start-DscConfiguration cmdlet specifically) 2 days trying to figure it out, now I am here :)
I am getting the following error for a specific MOF file, prior MOFs run fine.
The data source could not process the filter. The filter might be missing or it might be invalid. Change the filter
and try the request again.
+ CategoryInfo : InvalidArgument: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : HRESULT 0x8033801a
EDIT: Has anyone experienced this error before? I can share the MOF file in question, with some restricted info removed.
Thank you
The issue here wasn't with PowerShell DSC, rather just PowerShell in itself.
I had a cmdlet within a switch block. As an example:
Switch($item){
{$_ -eq $true}{do something}
{$_ -eq $fales}{do something}
get-service -name $item
}
It was the get-service cmdlet that could not be filtered.

powershell ver 2.0 search AD failure [duplicate]

We have mixed desktop operating systems consisting of windows 7 and windows 10. I have a login script that gathers various information from a powershell script that runs each time a user logs in. The windows 7 powershell is only version 2 which means I cannot use get-aduser, I am therefore challenged to query this information out of AD using a different method that would be compatible with both win7 and win10. I have this line of code that does not use get-aduser and successfully produces a list of all AD users on powershell 5(win10), however when I attempt to use it on powershell 2 it produces the error below.
My questions are these:
What do I need to change to get the script working on powershell version2 ?
How can I get it to output the current user as opposed to all the users in AD
thank you for any help in advance
<position> : The following exception was thrown when trying to enumerate the collection: "Configuration system failed t
o initialize".
At line:1 char:1
+ <<<< (New-Object DirectoryServices.DirectorySearcher "ObjectClass=user").FindAll() | Select-object -property path
+ CategoryInfo : NotSpecified: (:) [], ExtendedTypeSystemException
+ FullyQualifiedErrorId : ExceptionInGetEnumerator
(New-Object DirectoryServices.DirectorySearcher “ObjectClass=user”).FindAll() | Select-object -property path

query AD using powershell version 2

We have mixed desktop operating systems consisting of windows 7 and windows 10. I have a login script that gathers various information from a powershell script that runs each time a user logs in. The windows 7 powershell is only version 2 which means I cannot use get-aduser, I am therefore challenged to query this information out of AD using a different method that would be compatible with both win7 and win10. I have this line of code that does not use get-aduser and successfully produces a list of all AD users on powershell 5(win10), however when I attempt to use it on powershell 2 it produces the error below.
My questions are these:
What do I need to change to get the script working on powershell version2 ?
How can I get it to output the current user as opposed to all the users in AD
thank you for any help in advance
<position> : The following exception was thrown when trying to enumerate the collection: "Configuration system failed t
o initialize".
At line:1 char:1
+ <<<< (New-Object DirectoryServices.DirectorySearcher "ObjectClass=user").FindAll() | Select-object -property path
+ CategoryInfo : NotSpecified: (:) [], ExtendedTypeSystemException
+ FullyQualifiedErrorId : ExceptionInGetEnumerator
(New-Object DirectoryServices.DirectorySearcher “ObjectClass=user”).FindAll() | Select-object -property path

PowerShell, Office365: Set-Mailbox parameters raises error

I am using PowerShell for managing my Office365 account. When I try to set parameters for existing mailbox, PowerShell ISE raises error. When I specify "RetentionComment", "LitigationHoldEnabled", "RetentionUrl" or "MaxSendSize" as Set-Mailbox function the following error occurs:
A positional parameter cannot be found that accepts argument '-maxsendsize'.
+ CategoryInfo : InvalidArgument: (:) [Set-Mailbox], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Set-Mailbox`
These parameters documented in TechNet documentation library at
http://technet.microsoft.com/en-en/library/bb123981(v=exchg.150).aspx
For example I use the following commands with parameters:
Set-Mailbox -Identity "my.mailbox" -MaxSendSize 12345
Set-Mailbox "my.mailbox" -RetentionComment "Hello World!"
Set-Mailbox -Identity "my.mailbox" -LitigationHoldEnabled:$False
Any idea? Please help!
The MaxSendSize is only supported in Exchange 2013 or Exchange Online 2013. If your tenant has not been upgraded yet to wave 15 (the 2013 suite) you will not be able to use this command. Also, if you have ADFS set up you may also be unable to run this command because it must be set in AD and not in Exchange. Hope this helps.
For the -MaxSendSize 12345BI think you have to add a unit to the end so -MaxSendSize 12345B the available units are B/MB/GB/TB.
For -RetentionComment this comment can only be set if the RetentionHoldEnabled parameter is set to $true. So check that first.
For -LitigationHoldEnabled you don't need that : in there so -LitigationHoldEnabled $false