Tag Info

New answers tagged

0

There is a Powershell script to do this. You will need to tweak it for your environment/needs though. As it stands it requires human interaction. Found on SU here: http://superuser.com/questions/329309/how-to-reset-ie9 Credit: http://gallery.technet.microsoft.com/scriptcenter/Reset-Internet-Explorer-20f838e7 ...


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/


0

To reset Internet Explorer automatically, follow these steps: Note: This Microsoft Fix it is supported by Windows 7, Windows Vista and Windows XP. Download: http://go.microsoft.com/?linkid=9646978 In the File Download dialog box, click Run, and then follow the steps in the wizard. In the Reset Internet Explorer Settings dialog box, click Reset. Click to ...


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

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 ...


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 ...


0

The whole process can be done in powershell using the X509Certificate class available in the .Net framework. The first thing you need to do is get the cert file from the signed file. This is done using the CreateFromCertFile function. Just take note that the function can only take full paths and not relative ones. You can then open up the certificate store ...


0

You can store credentials in your scripts. You can then use the PSCredential object with the New-PSDrive cmdlet to connect to the share. The PSDriveInfo object is then accessible to your script during the length of the session. $username = 'domain\username' $password = 'secret' $password = $password | ConvertTo-SecureString -AsPlainText -Force ...


1

If you want to stick to using the pipeline, use the ForEach-Object cmdlet. New-Object System.Security.Principal.NTAccount("Students") | ForEach-Object { $_.Translate([System.Security.Principal.SecurityIdentifier]).Value) }


0

As you are running a script file instead of a script block, the parameter that you should use is -File. Additionally, setting the execution policy using the Set-ExecutionPolicy cmdlet does not guarantee that the script is executed in that context. The effective execution policy might be overwritten by group policy (GPO). To force this on on the execution ...


0

It's not too nice, but works! :) $RetainedDays = 14 $ArchiveBoundary = (Get-Date).AddDays(-$RetainedDays).ToString('yyyyMMdd') $ProcessFiles = Get-ChildItem -Path $RootPath -Recurse | Where-Object { ($_.BaseName -split '_|\.')[1] -lt $ArchiveBoundary }


0

See if this helps get you closer to what you're trying to do. $RootPath = "C:\temp" $ProcessFiles = @() $RetainedDays = 7 $Today = get-date -format yyyyMMdd $FileNameRegex = "\w+_(\d+)\.\w+" foreach ($File in Get-ChildItem -Path $RootPath) { $match = [regex]::matches($File, $FileNameRegex ) $FileNameDate = $match[0].Groups[1].Value if (($Today - ...


0

It seems a backslash is missing from the namespace path. Rather than "rootvirtualization" the path should be "root\virtualization"


0

Run WireShark on the client computer, log all the network traffic as the script runs. That's going to be a lot of data, but given that you're talking about manually running it on 800 servers, it's not going to be much worse than that. Look for failed DNS resolution, look at comparing the servers that worked and the servers that failed. WMI supports ...


0

Have you checked the Windows Firewall or 3rd party firewall software to confirm it's disabled or that it allows access to the server running the Powershell script? I'd also check the subnet mask and verify you have "File and Printer Sharing" enabled, on the failed clients.


0

Too bad the latest toolkit does not support the retrieval of ACL's. This error is common and means that this toolkit does not support certain versions of OnTap. PS C:\Users\m0132130> Get-NaCifsShareAcl | select ShareName -ExpandProperty UserAclInfo Get-NaCifsShareAcl : Unable to find API: cifs-share-acl-list-iter-start At line:1 char:19 + ...


1

For anyone coming across this page while doing a search, a much more complete solution is detailed at http://gsexdev.blogspot.com/2012/10/reporting-on-item-age-count-and-size-in.html


1

Continuing from your example, this would work: $guid = $user.get("msExchMailboxGUID") $thisDN2 = $twoUser.DistinguishedName $user2 = [ADSI]"LDAP://$thisDN2" $user2.put('msExchMailboxGUID', @($guid)) $user2.setinfo()


0

After tinkering with this for a couple hours, it looks like I was wrong. The cmdlet to get permissions on folder mailboxes actually does provide everything in the User.ADRecipient property. Get-MailboxFolderPermission "username:\Foldername" | Foreach-Object { $_.User.ADRecipient.UserPrincipalName } I discovered this by outputting the results using ...


3

$(New-Object System.Security.Principal.NTAccount("Students")).Translate([System.Security.Principal.SecurityIdentifier]).Value


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 ...


0

Even so, Search-Mailbox is the way to go forward, please read the following two paraphrases from http://technet.microsoft.com/en-us/library/dd298173%28v=exchg.141%29.aspx: "The DeleteContent switch specifies that the messages returned by the search be permanently deleted from the source mailbox. When used with the TargetMailbox parameter, messages ...


1

You might want to try something like this: $sqlDistUpdateRecord = "UPDATE distribution SET full_name='{0}', account_name='{1}', hide_from_gal='{2}' WHERE account_name='{1}'" -f $strDistName, $strDistSamAccountName, $strDistHidden


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 ...


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


0

Get-ADUSER -Filter * -SearchScope Subtree -SearchBase "OU=myou,OU=otherou,DC=mydc,DC=local" | %{ Set-ADAccountPassword $.Name -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "NewPassord" -Force) Enable-ADAccount $.Name Set-ADUSER $_.Name-ChangePasswordAtLogon $true }



Top 50 recent answers are included