728x90

매번 까먹어서 적어놓네요.

New-ItemProperty “HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\” -Name “DisabledComponents” -Value 0xffffffff -PropertyType “DWord"



혹은


네트워크 속성에서 ipV6 체크를 빼도 Win2008은 ipV6를 사용합니다.

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters" /v DisabledComponents /t REG_dword /d 4294967295 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v EnableTCPA /t REG_dword /d 0 /f
netsh int tcp set global chimney=disabled
netsh int tcp set global rss=disabled

netsh int tcp set global netdma=disabled


를 해주시고 네트워크 속성에서 체크를 빼주셔야

정확히 ipV4만 사용하게 됩니다.

몇시간 걸리고 시행착오 거쳐서 만든 스크립트입니다.


반대는

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters" /v DisabledComponents /t REG_dword /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v EnableTCPA /t REG_dword /d 1 /f
netsh int tcp set global chimney=enabled
netsh int tcp set global rss=enabled

netsh int tcp set global netdma=enabled

 





참조 - http://support.microsoft.com/kb/929852

728x90
728x90

결과 카운터 수를 하기 위해서 파워쉘로 나름 찾아보았습니다.

 

변수 $total 선언하고 이변수에 조회값을 담습니다.

그후 count를 사용하여 $total 값을 구하면 됩니다.

 

예)

PS C:\Windows\system32> $total = Get-CsUser -Filter {RegistrarPool -eq 'pool.fedev.com'}

PS C:\Windows\system32> $total.count
408

 

결과 값은 408이 떨어지는군요.

728x90
728x90

사용자 만료일자를 추출하는 쿼리입니다.

실제 운영에서 유용하게 사용 할 수 있을 듯 합니다.

 

function Get-XADUserPasswordExpirationDate() {

    Param ([Parameter(Mandatory=$true,  Position=0,  ValueFromPipeline=$true, HelpMessage="Identity of the Account")]

    [Object] $accountIdentity)

    PROCESS {

        $accountObj = Get-ADUser $accountIdentity -properties PasswordExpired, PasswordNeverExpires, PasswordLastSet

        if ($accountObj.PasswordExpired) {

            echo ("Password of account: " + $accountObj.Name + " already expired!")

        } else {

            if ($accountObj.PasswordNeverExpires) {

                echo ("Password of account: " + $accountObj.Name + " is set to never expires!")

            } else {

                $passwordSetDate = $accountObj.PasswordLastSet

                if ($passwordSetDate -eq $null) {

                    echo ("Password of account: " + $accountObj.Name + " has never been set!")

                }  else {

                    $maxPasswordAgeTimeSpan = $null

                    $dfl = (get-addomain).DomainMode

                    if ($dfl -ge 3) {

                        ## Greater than Windows2008 domain functional level

                        $accountFGPP = Get-ADUserResultantPasswordPolicy $accountObj

                        if ($accountFGPP -ne $null) {

                            $maxPasswordAgeTimeSpan = $accountFGPP.MaxPasswordAge

                        } else {

                            $maxPasswordAgeTimeSpan = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge

                        }

                    } else {

                        $maxPasswordAgeTimeSpan = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge

                    }

                    if ($maxPasswordAgeTimeSpan -eq $null -or $maxPasswordAgeTimeSpan.TotalMilliseconds -eq 0) {

                        echo ("MaxPasswordAge is not set for the domain or is set to zero!")

                    } else {

                        echo ("Password of account: " + $accountObj.Name + " expires on: " + ($passwordSetDate + $maxPasswordAgeTimeSpan))

                    }

                }

            }

        }

    }

}
 

 

사용방법

 

Import-module activedirectory
 
get-aduser -filter {Enabled -eq $True} -properties * | Get-XADUserPasswordExpirationDate 

 

 

출처 : http://blog.sogooday.com/239

728x90
728x90

Lync Service를 서비스관리자에서 한땀한땀 올리려면 대기시간과 귀차니즘의 극에 달한다.

하지만 파워쉘 명령 두번이면 재시작 끝이다.

 

 1. Open the Lync Server Management Shell.

2. Run the following Lync Server PowerShell commands in the given order:

Stop-CsWindowService

 

Start-CsWindowsService

 

참 쉽죠이~

 

끝.

728x90

+ Recent posts