Tag Info

Hot answers tagged

10

Provided you have a Windows 2012 Domain controller, yes! Where can we find group membership details? When you look into the member attribute of an AD group you’ll find a list of all members in distinguished name format. But that’s it. There is no smoking gun or finger prints that tell you how they got there. However, there is a little-known piece of ...


7

There's a subtle difference in behavior that the 2012 version "optionally removes" the feature, and that IncludeManagementTools must be included as a parameter to remove the management console as part of the uninstallation of the feature, and Remove must be included to remove the feature files from the computer that would allow the feature to be reinstalled. ...


7

If you really want to know what exact LDAP queries are being performed by the Powershell Cmdlets, then you can decompile them by using DotPeek, using the method I outline here: https://www.myotherpcisacloud.com/post/2013/07/08/Taking-a-Peek-Inside-Powershell-Cmdlets.aspx Use $(Get-Command Get-ADUser).DLL to see what DLL the Cmdlet is being imported from. ...


7

To address the most basic part of your question: Yes, you can send commands to a Windows Server from a web interface using the PowerShell Web Access feature in Windows Server 2012 and 2012 R2. For what you want (linking a user control in a web page to the execution of a specific action on the server), you might want to look into executing PowerShell from ...


6

The ActiveDirectory module has clever logic that calculate "popular" properties like whether a user account is Enabled or have PasswordNeverExpires set and presents them like regular attributes. Internally, they're derived from actual account attributes like userAccountControl and pwdLastSet. Account Settings userAccountControl is a bitfield, and contains ...


6

This is because of the way Powershell handles variables in quotes. Basically, rather than getting $_.SamAccountName You were actually getting $_ + "SamAccountName" To resolve this simply use the following method to encapsulate your variables: Set-ADUser $_.SamAccountName -HomeDrive "Z:" -HomeDirectory "\\serverName\shareName\$($_.SamAccountName)" ...


5

The only thing I can think of to solve this is a trick where you use an intermediate group as a dynamic object and then nest that into the primary group so that the user has the permissions conferred to the primary group by way of nested group membership, however, the intermediate group has a TTL (time to live, the entry-TTL attribute) and when that TTL ...


4

I think you'd have the best luck spending some time learning about the AD schema and building queries yourself, rather than trying to reverse-engineer Microsoft's own tools. AD is enough of a plain-vanilla LDAP directory that reference articles that speak about LDAP generally will be applicable. There are some oddball things like bit fields in attributes ...


4

I managed to fix this issue by going to the following location in ADSIEDIT Domain > Configuration > Services Right Click CN=Microsoft Exchange > Properties Found and Removed a bad entry from the GlobalAddressList1 attribute.


4

Be lazy, just get the Manager attribute on your first pass and juggle it through the pipeline to your calculated property. Search-ADAccount -AccountExpiring -TimeSpan "7" | Get-ADUser -Properties Name, AccountExpirationDate, Manager | Select-Object Name, AccountExpirationDate, @{ name = 'Manager'; expression = { (Get-ADuser $_.Manager -Properties ...


4

In powershell v4 (and possibly v3) you can do the following: [PS] > $a.url -contains 'win-coll2.astest.org' True [PS] > $a.url -contains 'win-coll7.astest.org' False Otherwise, I think the easiest, least painful way is either do a foreach or a foreach-object...


4

Microsoft is pretty clear: WMF 4.0 can only be installed on the following operating systems. Windows 7 with Service Pack 1 Windows Server 2008 R2 with Service Pack 1 Windows Server 2012 **You cannot install this software on computers that are running Windows 8.** Can't even install it on Windows 8.0, let alone Vista. So, your clients on Vista are ...


3

The minimum requirements for Windows Management Framework 4.0 are Windows 7 SP1 and 2008 R2 SP1. The reason why it explicitly won't install on Windows 8, is because Windows 8.1 is a free upgrade to Windows 8, and everyone wants you to upgrade away from Windows 8 to 8.1. Since this Q&A site is supposed to be about professional systems administration, I ...


3

Solved! I had to use the 32-bit version of Powerhell as the module is in the folder: C:\Windows\System32\WindowsPowerShell\v1.0\Modules\


3

Here's a code I found and modified for this. $Merged = @() $Scopes = Get-DhcpServerv4Scope -ComputerName dc2008 #-ScopeId '10.1.230.0' Foreach ($Scope In $Scopes) { $IP_res = (Get-DhcpServerv4Reservation -ComputerName dc2008 -ScopeId $Scope.ScopeId) $IP_lease =(Get-DhcpServerv4Lease -ComputerName dc2008 -ScopeId $Scope.ScopeId) $IP_lease + ...


3

add `-noexit' PowerShell.exe -noexit -Command Enter-PSSession -computername Win2012SrvCore -credential administrator


3

That cmdlet is part of the Exchange 2013 Management Shell. You need to be in the Exchange Management Shell itself, not a separate PowerShell, to run it.


2

If you import the AD powershell module you shouldn't need to use extra directoryservices objects (at least not on this occasion). You can use the Get-ADGroupMember cmdlet with -Resursive and it should find your nested users also. Edit: I added -Server arguments to the AD cmdlets so you can specify particular DCs. Timestamp attributes may differ (they do ...


2

Nothing PS C:\> help remove-windowsfeature NAME Uninstall-WindowsFeature SYNTAX Uninstall-WindowsFeature [-Name] <Feature[]> [-Restart] [-IncludeManagementTools] [-Remove] [-ComputerName <string>] [-Credential <pscredential>] [-LogPath <string>] [-WhatIf] [-Confirm] [<CommonParameters>] ...


2

Azure Automation runbooks are just PowerShell Workflows, which can be run in the PowerShell ISE on your local machine as well. The only thing special about runbooks compared to PowerShell Workflows is in runbooks you can use the "Automation activities" (Get-AutomationVariable, Get-AutomationPSCredential, etc). We don't have a blog post about this out for ...


2

$passwd = convertto-securestring -AsPlainText -Force -String MYPASSWORD $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist "administrator",$passwd $session = new-pssession -computername Win2012SrvCore -credential $cred Add one more line: Import-PSSession $session Then save the .PS1 file and create a shortcut to it as ...


2

Most of the answers in the forums solve this with a workaround like echoing and piping so that powershell gets some input from STDIN. But there exits a solution within powershell. Just start powershell with the option -inputformat none like: powershell -inputformat none -command ... This solves the hanging issue via psexec for Win2003 and Win2008.


1

The registry key, that MDMarra is referring to should be HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI (assuming later than XP). Look in LastLoggedOnUser.


1

This will export the licensed users with license type Get-MsolUser -All |Where {$_.IsLicensed -eq $true } |Select DisplayName,UsageLocation,@{n="Licenses Type";e={$_.Licenses.AccountSKUid}},SignInName,UserPrincipalName,@{n="ProxyAddresses";e={$_.ProxyAddresses}}| Export-csv -Path C:\ExportlicenseUsage.csv -notype


1

The split between Validation and List is intended to direct what result to expect. Validation tests are boolean and return pass/fail, yes/no, up/failed, etc. The List tests return statistical and operational data for review. Microsoft built the tests with Zero Downtime in mind. And for the most part that's true. There are tests which will trigger a ...


1

This is a hack but it works. Grabbed the Get-ADUserLastLogon from a Microsoft Article (http://technet.microsoft.com/en-us/library/dd378867%28v=ws.10%29.aspx) Import-Module ActiveDirectory function Get-ADUserLastLogon([string]$userName) { $dcs = Get-ADDomainController -Filter {Name -like "*"} $time = 0 foreach($dc in $dcs) { $hostname = ...


1

Instead of ft end the script with export-csv and the appropriate switches.


1

I'm not sure about the exact problem you're facing, you have not really described it. That said, would one of the switches on New-MailboxRepairRequest perform what you need? Also, it is helpful to know what version of Exchange you're running.


1

The New-Website and New-WebBinding[2] applets should do what you are asking. 1: http://technet.microsoft.com/en-us/library/ee790605.aspx 2: http://technet.microsoft.com/en-us/library/ee790567.aspx


1

I presume your certificate requests are made using a template. If that's the case then use the Public Key Policies/Certificate Services Client - Auto-Enrollment Settings GPO to enforce auto enrollment. You'll also want to ensure the template ACL has Enroll and AutoEnroll marked for either domain computers or domain users (or whatever acl object, depending ...



Only top voted, non community-wiki answers of a minimum length are eligible