Hot answers tagged powershell
2
It looks like you need to convert the ExtendedRights property to string.. to do this.. use the ToString method
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method ...
2
I slowly managed to write a script that does what I need, and I'll share a sanitized version. For each mailbox, make assign their signatures - both text and HTML version. Depending on the phone types the user has, it makes their sigantures accordingly.
Import-Module ActiveDirectory
. 'C:\Program Files\Microsoft\Exchange ...
2
An easier and less confusing way to trap cmdlet specific errors to a file is by using the -Errorvariable parameter. It is built into most cmdlets. It is not reliable to look at the $Error variable as it is a global variable and has a high chance of being stained by other unmitigated errors in the powershell process.
The code below will log the errors in 2 ...
1
You're on the right track with the mailboxes. Some users likely have other objects underneath them so you can't delete the users until you delete those objects. This link has a useful code snippet you can adapt for your use:
http://andrewbeaton.net/faq/2012/07/04/cannot-remove-ad-user-with-nested-leaf-objects/
1
There are a lot of different ways to do this. Here is something I just cooked up.
$Error.Clear() # This is a global variable!
$Errors = @()
$Items = Get-ChildItem C:\ -Recurse -ErrorAction SilentlyContinue
ForEach($Err In $Error)
{
$Errors += $Err.Exception
}
ForEach($Item In $Items)
{
Try
{
$Item | Get-ACL -ErrorAction ...
1
I think using PowerShell might be the way to go.
$srcStoreScope = "CurrentUser"
$srcStoreName = "CA"
$srcStore = New-Object System.Security.Cryptography.X509Certificates.X509Store $srcStoreName, $srcStoreScope
$srcStore.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadOnly)
$cert = $srcStore.certificates -match "sometext"
...
1
You can connect to any Exchange org provided you have the proper IP connectivity to it. And you can install the Exchange Management Shell on any computer you want, even if your current forest doesn't have any Exchange servers in it.
To connect via the Exchange Management Console, just right-click on the Microsoft Exchange logo in the tree on the left and ...
Only top voted, non community-wiki answers of a minimum length are eligible