달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
아래 스크립트와 동일하게 프로세스의 CPU 사용률을 가져오기 위한 VB 스크립트입니다. 기존 방법들과 다른 점은 Refresher라는 메서드를 이용합니다. 아래 사이트를 확인해 보면, 단순히 Win32_PerfFormattedData_PerfProc_Process 클래스를 쿼리하는 경우에는 정확한 값이 나오지 않을 수 있다고 합니다.

http://blogs.technet.com/b/heyscriptingguy/archive/2005/04/21/why-does-my-performance-monitoring-script-keep-returning-the-same-incorrect-values.aspx



'Instance: $Data/Property[@Name='Instance']$
'PerfValue: $Data/Property[@Name='PerfValue']$

strProcessName = "svchost"

Set oAPI = CreateObject("MOM.ScriptAPI")
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")

Set objRefresher = CreateObject("WbemScripting.SWbemRefresher")

Set colItems = objRefresher.AddEnum(objWMIService, "Win32_PerfFormattedData_PerfProc_Process").objectSet

objRefresher.Refresh
Wscript.Sleep 1000
objRefresher.Refresh

For Each Item In colItems
  strInstance = Item.Name
  strPerfValue = Item.PercentProcessorTime

  tmpString = ""
  If InStr(strInstance,"#") <> 0 Then
    tmpString = Left(strInstance,InStr(strInstance,"#")-1)
  End If

  If Ucase(strInstance) = Ucase(strProcessName) OR Ucase(tmpString) = Ucase(strProcessName) Then
    If tmpString <> "" Then
      strInstance = tmpString&"_"&Item.IDProcess
    Else
      strInstance = strInstance&"_"&Item.IDProcess
    End If

    WScript.Echo strInstance, strPerfValue

'    Set propertyBag = oAPI.CreatePropertyBag()
'    propertyBag.AddValue "Instance", strInstance
'    propertyBag.AddValue "PerfValue", strPerfValue
'    oAPI.AddItem(propertyBag)
  End If
Next

Set colItems = Nothing
'oAPI.ReturnItems



 
:
Posted by 커널64
2014. 2. 20. 10:44

typeperf 명령을 통한 성능 수집 VB 스크립트 Etc.2014. 2. 20. 10:44

SCOM을 통해 성능 수집을 할 때 보통 WMI를 쿼리해서 수집하는데, 프로세스 CPU 사용률에 대한 값이 영 믿을만한 값이 아닌 것 같아 다른 방법이 없을까..하고 찾아보던 중 성능 카운터를 쿼리하는 typeperf라는 명령이 있더군요...
아래 스크립트는 이 typeperf 명령 결과를 이용해 화면에 출력하거나 SCOM의 성능 카운터로 저장하는 스크립트입니다.


'Instance: $Data/Property[@Name='Instance']$
'PerfValue: $Data/Property[@Name='PerfValue']$

strProcessName = "svchost"

Set oAPI = CreateObject("MOM.ScriptAPI")

strCmdProcID = "typeperf "&chr(34)&"\Process(*)\ID Process"&chr(34)&" -sc 1"
strCmdCPUPerf = "typeperf "&chr(34)&"\Process(*)\% Processor Time"&chr(34)&" -sc 1"

Set objShell = WScript.CreateObject("WScript.Shell")

Set objExecObjectProcID = objShell.Exec(strCmdProcID)
Set objExecObjectCPUPerf = objShell.Exec(strCmdCPUPerf)

strComputerName = objShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )

i = 0
Do While Not objExecObjectProcID.StdOut.AtEndOfStream
  tmpLine = objExecObjectProcID.StdOut.ReadLine()
  Select Case i
  Case "1"
    tmpLine = Replace(tmpLine,"\\"&strComputerName&"\Process(","")
    tmpLine = Replace(tmpLine,")\ID Process","")
    tmpLine = Replace(tmpLine,chr(34),"")
    strHeader = tmpLine
  Case "2"
    tmpLine = Replace(tmpLine,".000000","")
    tmpLine = Replace(tmpLine,chr(34),"")
    strResult = tmpLine
  End Select
  i = i + 1
Loop
ProcIDHeader = Split(strHeader,",")
ProcIDResult = Split(strResult,",")

i = 0
Do While Not objExecObjectCPUPerf.StdOut.AtEndOfStream
  tmpLine = objExecObjectCPUPerf.StdOut.ReadLine()
  Select Case i
  Case "1"
    tmpLine = Replace(tmpLine,"\\"&strComputerName&"\Process(","")
    tmpLine = Replace(tmpLine,")\% Processor Time","")
    tmpLine = Replace(tmpLine,chr(34),"")
    strHeader = tmpLine
  Case "2"
    tmpLine = Replace(tmpLine,chr(34),"")
    strResult = tmpLine
  End Select
  i = i + 1
Loop
ProcCPUHeader = Split(strHeader,",")
ProcCPUResult = Split(strResult,",")

For i = 0 to Ubound(ProcIDHeader)
  tmpProcIDHeader = ""
  If InStr(ProcIDHeader(i),"#") <> 0 Then
    tmpProcIDHeader = Left(ProcIDHeader(i),InStr(ProcIDHeader(i),"#")-1)
  End If
  If Ucase(ProcIDHeader(i)) = Ucase(strProcessName) or Ucase(tmpProcIDHeader) = Ucase(strProcessName) Then
    WScript.Echo ProcIDHeader(i),ProcIDResult(i),ProcIDHeader(i),ProcCPUResult(i)
'    Set propertyBag = oAPI.CreatePropertyBag()
'    propertyBag.AddValue "Instance", ProcIDHeader(i)
'    propertyBag.AddValue "PerfValue", ProcCPUResult(i)
'    oAPI.AddItem(propertyBag)
  End If
Next

'oAPI.ReturnItems



 
:
Posted by 커널64

Windows Azure Pack, 전체 이름은 Windows Azure Pack for Windows Server, 짧게는 WAP

WAP에서는 자동화라는 기능을 제공합니다. 이는 PowerShell 명령을 통해 WAP에 관련된 여러가지 일들을 처리할 수 있도록 해 주는 기능으로 Orchestrator의 Runbook과는 별개로 동작합니다.

하지만, 대부분 이미 Orchestrator에 익숙해져 있고, GUI를 통해 Runbook을 제작하고 사용하는 것이 운영 관점에서 수월할 수 있으므로, WAP의 자동화 기능을 통해, 즉, PowerShell을 통해 Orchestrator의 Runbook을 실행하는 방법을 설명합니다.

먼저, WAP 관리자 포탈에 로그인 한 후 자동화 메뉴로 이동합니다.



상단 메뉴에서 자산으로 이동한 후 아래의 설정 추가 메뉴를 차례로 클릭합니다.



자격 증명 추가를 클릭한 후 Orchestrator의 실행 권한을 가지는 계정 정보를 입력합니다.


자격 증명 추가를 완료한 후 아래의 새로 만들기를 클릭해 Runbook -> 빠른 생성을 차례로 클릭해 Runbook의 이름과 설명, 태그 등을 입력합니다. (주의: Runbook의 이름은 이후 변경할 수 없습니다.)


자동화 -> 해당 Runbook -> 작성자 -> 초안을 차례로 클릭해 Runbook 작성 메뉴로 이동합니다.


아래는 테스트에 사용한 Runbook 샘플입니다.
workflow Invoke-OrchRunbook-CreateEvent
{
    $SCOserverName = "Orchesrator 서버 이름"
    $PSCredName = "이전 과정에서 생성한 자격 증명 이름"
   
    $PSUserCred = Get-AutomationPSCredential -name $PSCredName
    $RunbookPath = "Runbook의 위치 및 이름"

    # Runbook의 위치는 최상위에 있는 경우 '\<Runbook 이름>'의 형태로 입력하면 되며,
    # 폴더 하위에 위치하는 경우에는 '\<폴더 이름>\<Runbook 이름>의 형태로 입력합니다.'

    $URL = Get-OrchestratorServiceUrl -server $SCOserverName
   
    $Param1 = "매개 변수 1"
    $Param1GUID = ""
    $Param2 = "매개 변수 2"
    $Param2GUID = ""
    $Runbook = Get-OrchestratorRunbook -serviceurl $URL -runbookpath $RunbookPath -credentials $PSUserCred
   
    Foreach ($Param in $Runbook.Parameters)
    {
        If ($Param.Name -eq $Param1) {$Param1GUID = $Param.Id}
        ElseIf ($Param.Name -eq $Param2) {$Param2GUID = $Param.Id}
    }
   
    [Hashtable] $Params = @{
        $Param1GUID = "매개 변수 1 값";
        $Param2GUID = "매개 변수 2 값";
    }
   
    $Job = Start-OrchestratorRunbook -runbook $Runbook -parameters $Params -credentials $PSUserCred
    $Job
}



:
Posted by 커널64
2013. 10. 23. 11:31

VBS로 PowerShell 스크립트 실행 Etc.2013. 10. 23. 11:31

가상화 관련 프로젝트를 진행하다 보니 VBS로 PowerShell 스크립트를 실행해야 하는 경우가 생깁니다. SCOM의 경우 Discovery는 Authoring Console을 통해 PowerShell 기반의 Discovery가 가능하나 정작 운영 콘솔 상에서 모니터링 항목을 만들 때는 PowerShell 스크립트를 지원하지 않아 PowerShell 명령으로 모니터링을 하기가 쉽지 않습니다.

물론, Authoring Console을 이용하면 되지만 매우 복잡한 단계를 거쳐야 하기 때문에 간단하게 VBS 스크립트 안에서 PowerShell 스크립트를 실행하거나, 출력된 결과에 기반해 모니터링을 수행할 수 있습니다.


단순 실행 - 출력된 결과에 대한 작업이 필요 없는 경우
(예: 실패한 클러스터 리소스 시작)
PS = "powershell.exe -nologo -command "&Chr(34)&"Get-ClusterResource | Where {$_.State -eq 'Failed'} | Start-ClusterResource"&Chr(34)
 
Set Shell = CreateObject("WScript.Shell")
Shell.Run PS,0,True



결과 반환 - 반환된 결과에 대한 가공 또는 분석이 필요한 경우
PS = "powershell.exe -nologo -command "&chr(34)&"Get-Service | Where {$_.Status -eq 'Stopped'}"&chr(34)

Set Shell = WScript.CreateObject( "WScript.Shell" )
Set Exec = Shell.Exec(PS)
Exec.StdIn.Close()
 
Do While Exec.StdOut.AtEndOfStream <> True
  PSOutput =  Exec.StdOut.ReadLine
  
  <PSOutput 작업>
  
Loop



:
Posted by 커널64
VBS VB 스크립트 기반 SCOM 모니터 - 장애 조치 클러스터의 실패한 클러스터 리소스 그룹 모니터링


'==========================================================
'Normal State: Property[@Name='State'] equals Normal
'Error State: Property[@Name='State'] equals Critical
'Alert Message: $Data/Context/Property[@Name='Message']$
'==========================================================

On Error Resume Next

Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()

Set wshShell = WScript.CreateObject( "WScript.Shell" )

strHostName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
Set wshShell = Nothing

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\mscluster")
Set colItems = objWMIService.ExecQuery("Select * from MSCluster_ResourceGroup Where OwnerNode = '"&strHostName&"' And State = 2")

strFailedRes = ""
If colItems.Count <> 0 Then
  For each Item in colItems
    strFailedRes = strFailedRes & Item.Name & ", "
    Call oBag.AddValue("Failed Resource", Item.Name)
  Next
  Call oBag.AddValue("State", "Critical")
  If colItems.Count = 1 Then
    Call oBag.AddValue("Message", "There is a Failed Cluster Resource. '"&Left(strFailedRes,Len(strFailedRes)-2)&"'")
  Else
    Call oBag.AddValue("Message", "There are Failed Cluster Resources. '"&Left(strFailedRes,Len(strFailedRes)-2)&"'")
  End If
Else
  Call oBag.AddValue("State", "Normal")
  Call oBag.AddValue("Message", "There is no Failed Cluster Resource.")
End If

Set colItems = Nothing
Set objWMIService = Nothing

Call oAPI.Return(oBag)
Set oBag = Nothing 
Set oAPI = Nothing


 
:
Posted by 커널64
#####################################
 $ClusterName = "<Hyper-V 클러스터 이름>"
 $DPMServerName = "<DPM 서버 이름>"

 $PGPrefix = "<보호 그룹 접두어>"
 $VMPrefix = "<VM 이름 접두어>"
#####################################

If ($DPMServerName -notlike "*.$env:userdnsdomain")
{
  $DPMFQDN = $DPMServerName+".$env:userdnsdomain"
}
Else
{
  $DPMFQDN = $DPMServerName
}

Connect-DPMServer $DPMFQDN

$Cluster = Get-DPMProductionCluster $DPMFQDN | Where {$_.ClusterName -like "$ClusterName.*"}
$NotProtectedVM = Get-DPMProductionVirtualName $Cluster | Where {$_.MachineName -like "SCVMM*$VMPrefix*" -and $_.ServerProtectionState -ne "HasDatasourcesProtected"}

# 초기 복제 시간 설정 (밤 12시)
$tmpDate = Get-Date
$tmpDate = [String]$tmpDate.Year+"-"+[String]$tmpDate.Month+"-"+[String]$tmpDate.Day
$tmpDate = [DateTime]$tmpDate
$ReplicaCreationTime = [DateTime]$tmpDate.AddDays(1)

# 백업되고 있지 않은 VM을 보호 그룹에 추가
# 보호 그룹은 구성원 수가 가장 적은 그룹 선택
foreach ($Item in $NotProtectedVM)
{
  $TargetDS = $Item | Get-DPMDatasource -Inquire | Where {$_.ObjectType -like "*Hyper-V*"}
  If (! $TargetDS) {continue}
  Else
  {
    $TargetPG = Get-DPMProtectionGroup $DPMFQDN | Where {$_.Name -like "$PGPrefix*"} | Sort-Object -Property NumberOfShortTermDatasources,TotalDiskReplicaSize | Select-Object -First 1
    $MPG = Get-DPMModifiableProtectionGroup $TargetPG
    $NPG = Add-DPMChildDatasource -ProtectionGroup $MPG -ChildDatasource $TargetDS
    $DiskAlloc = Get-DatasourceDiskAllocation -Datasource $TargetDS
    Set-DatasourceDiskAllocation -Datasource $TargetDS -ProtectionGroup $MPG
    Set-DPMReplicaCreationMethod -ProtectionGroup $MPG -Later $ReplicaCreationTime
    Set-DPMProtectionGroup $MPG
  }
}


 
:
Posted by 커널64
Windows Server 2012 기반의 Hyper-V 인프라 구성 시 필요한 몇 가지 구성들을 '빼먹지 않고', 좀 더 '손 쉽게' 할 수 있도록 PowerShell 스크립트로 만들어 보았습니다. 기본적인 권장 구성과 역할 및 기능 설치, 네트워크 관련 설정들이 포함됩니다.






Function Essential
{
  Clear-Host
  Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 2"
  Write-Host `n"------------------------------------"
  Write-Host "-- Essential Settings for Hyper-V --"
  Write-Host "------------------------------------"`n
  Write-Host "Checking Current Status ..."`n

  Write-Host -NoNewline " - TCP Chimney Offload: "
  $NetGlobalSettings = Get-NetOffloadGlobalSetting
  If ($NetGlobalSettings.Chimney -eq "Enabled") {Write-Host -foregroundColor Red "Enabled"}
  Else {Write-Host -foregroundColor Green "Disabled"}

  Write-Host -NoNewline " - User Access Control: "
  $LUA = Get-ItemProperty "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
  If ($LUA.EnableLUA -ne "0") {Write-Host -foregroundColor Red "Enabled"}
  Else {Write-Host -foregroundColor Green "Disabled"}

  Write-Host -NoNewline " - IP Version 6 (IPv6): "
  $IPv6 = Get-ItemProperty "HKLM:SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters"
  If ($IPv6.DisabledComponents -ne "4294967295") {Write-Host -foregroundColor Red "Enabled"}
  Else {Write-Host -foregroundColor Green "Disabled"}

  Write-Host -NoNewline " - Remote Desktop Connection: "
  $RDP = Get-ItemProperty "HKLM:SYSTEM\CurrentControlSet\Control\Terminal Server"
  If ($RDP.fDenyTSConnections -ne "0") {Write-Host -foregroundColor Red "Disabled"}
  Else {Write-Host -foregroundColor Green "Enabled"}

  Write-Host -NoNewline " - Remote Desktop Network Level Authentication: "
  $RDPSet = Get-ItemProperty "HKLM:SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
  If ($RDPSet.UserAuthentication -ne "0") {Write-Host -foregroundColor Red "Enabled"}
  Else {Write-Host -foregroundColor Green "Disabled"}

  Write-Host -NoNewline " - Remote Server Management: "
  $RemoteMgmt = Invoke-Expression -Command "Configure-SMRemoting.exe -GET"
  If ($RemoteMgmt -like "*사용하지 않도록*") {Write-Host -foregroundColor Red "Disabled"}
  Else {Write-Host -foregroundColor Green "Enabled"}

  Write-Host -NoNewline " - Firewall Exception(Remote Desktop Connection): "
  $FWRules = Get-NetFirewallRule | Where {$_.Group -eq "@FirewallAPI.dll,-28752"}
  $FWState = 0
  foreach ($Item in $FWRules)
  {
    If ($Item.Enabled -eq "False") {$FWState = 1}
  }
  If ($FWState -eq 1) {Write-Host -foregroundColor Red "Disabled"}
  Else {Write-Host -foregroundColor Green "Enabled"}

  Write-Host -NoNewline " - Firewall Exception(File and Printer Sharing): "
  $FWRules = Get-NetFirewallRule | Where {$_.Group -eq "@FirewallAPI.dll,-28502"}
  $FWState = 0
  foreach ($Item in $FWRules)
  {
    If ($Item.Enabled -eq "False") {$FWState = 1}
  }
  If ($FWState -eq 1) {Write-Host -foregroundColor Red "Disabled"}
  Else {Write-Host -foregroundColor Green "Enabled"}

  Write-Host -NoNewline " - Firewall Exception(Windows Remote Management): "
  $FWRules = Get-NetFirewallRule | Where {$_.Group -eq "@FirewallAPI.dll,-30267"}
  $FWState = 0
  foreach ($Item in $FWRules)
  {
    If ($Item.Enabled -eq "False") {$FWState = 1}
  }
  If ($FWState -eq 1) {Write-Host -foregroundColor Red "Disabled"}
  Else {Write-Host -foregroundColor Green "Enabled"}

  Write-Host -NoNewline " - Firewall Exception(Remote Service Management): "
  $FWRules = Get-NetFirewallRule | Where {$_.Group -eq "@FirewallAPI.dll,-29502"}
  $FWState = 0
  foreach ($Item in $FWRules)
  {
    If ($Item.Enabled -eq "False") {$FWState = 1}
  }
  If ($FWState -eq 1) {Write-Host -foregroundColor Red "Disabled"}
  Else {Write-Host -foregroundColor Green "Enabled"}
  
  Write-Host -NoNewline " - Firewall Exception(COM+ Remote Management): "
  $FWRules = Get-NetFirewallRule | Where {$_.Group -eq "@comres.dll,-3405"}
  $FWState = 0
  foreach ($Item in $FWRules)
  {
    If ($Item.Enabled -eq "False") {$FWState = 1}
  }
  If ($FWState -eq 1) {Write-Host -foregroundColor Red "Disabled"}
  Else {Write-Host -foregroundColor Green "Enabled"}

  Write-Host -NoNewline " - Firewall Exception(Remote Event Log Management): "
  $FWRules = Get-NetFirewallRule | Where {$_.Group -eq "@FirewallAPI.dll,-29252"}
  $FWState = 0
  foreach ($Item in $FWRules)
  {
    If ($Item.Enabled -eq "False") {$FWState = 1}
  }
  If ($FWState -eq 1) {Write-Host -foregroundColor Red "Disabled"}
  Else {Write-Host -foregroundColor Green "Enabled"}

  Write-Host -NoNewline " - Firewall Exception(WMI(Windows Management Instrumentation)): "
  $FWRules = Get-NetFirewallRule | Where {$_.Group -eq "@FirewallAPI.dll,-34251"}
  $FWState = 0
  foreach ($Item in $FWRules)
  {
    If ($Item.Enabled -eq "False") {$FWState = 1}
  }
  If ($FWState -eq 1) {Write-Host -foregroundColor Red "Disabled"}
  Else {Write-Host -foregroundColor Green "Enabled"}

  Write-Host -NoNewline " - Disallow Client Printer Redirection: "
  $PrinterMap = Get-ItemProperty "HKLM:SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services"
  If ($PrinterMap.fDisableCpm -ne "1" -or $PrinterMap.fDisableCpm -eq $NULL) {Write-Host -foregroundColor Red "Disabled"`n}
  Else {Write-Host -foregroundColor Green "Enabled"`n}

  Do
  {
    Write-Host -NoNewline `n"Set All to Desired Configurations? "
    Write-Host -foregroundColor Yellow -NoNewline "[Y]"
    Write-Host -NoNewline " or "
    Write-Host -foregroundColor Yellow -NoNewline "[N]"
    Write-Host -NoNewline ": "
    $DesiredConfig = Read-Host
  }
  While ($DesiredConfig -ne "Y" -and $DesiredConfig -ne "N")

  Switch ($DesiredConfig)
  {
    "Y"
    {
      Clear-Host
      Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 3"

      Write-Host `n`n"Disable TCP Chimney Offload"
      Set-NetOffloadGlobalSetting -Chimney Disabled
      Write-Host " -> Completed!"

      Write-Host `n"Turn Off User Access Control"
      Set-ItemProperty "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name EnableLUA -Value 0
      Write-Host " -> Completed!"

      Write-Host `n"Disable IP Version 6 (IPv6)"
      Set-ItemProperty "HKLM:SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" -Name DisabledComponents -Value 4294967295
      Write-Host " -> Completed!"

      Write-Host `n"Enable Remote Desktop Connection"
      Set-ItemProperty "HKLM:SYSTEM\CurrentControlSet\Control\Terminal Server" -Name fDenyTSConnections -Value 0
      Write-Host " -> Completed!"

      Write-Host `n"Disable Remote Desktop Network Level Authentication"
      Set-ItemProperty "HKLM:SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name UserAuthentication -Value 0
      Write-Host " -> Completed!"

      Write-Host `n"Enable Remote Server Management"
      $RemoteMgmt = Invoke-Expression -Command "Configure-SMRemoting.exe -Enable"
      $CommandLineStr = "winrm set winrm/config/client '@{TrustedHosts="+$([Char]34)+"*"+$([Char]34)+"}'"
      $RemoteMgmt = Invoke-Expression -Command $CommandLineStr
      Write-Host " -> Completed!"

      Write-Host `n"Configure Firewall Exceptions"
      $TargetFWRules = Get-NetFirewallRule | Where {$_.Group -eq "@FirewallAPI.dll,-28752" -or $_.Group -eq "@FirewallAPI.dll,-28502" -or $_.Group -eq "@FirewallAPI.dll,-30267" -or $_.Group -eq "@FirewallAPI.dll,-29502" -or $_.Group -eq "@comres.dll,-3405" -or $_.Group -eq "@FirewallAPI.dll,-29252" -or $_.Group -eq "@FirewallAPI.dll,-34251" -or $_.Group -eq "@FirewallAPI.dll,-29002"}
      $TargetFWRules | Set-NetFirewallRule -Enabled True
      Write-Host " -> Completed!"

      Write-Host `n"Disallow Client Printer Redirection"
      Set-ItemProperty "HKLM:SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" -Name fDisableCpm -Value 1
      Write-Host " -> Completed!"

      Write-Host `n`n"Press Any Key to Continue..."
      $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
    }

    "N"
    {
      Write-Host `n"Canceled."
      Start-Sleep 1
      Break
    }
  }
}


Function WindowsFeatures
{
  Clear-Host
  Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 2"
  Write-Host `n"----------------------------------------------------------"
  Write-Host "-- Windows Features for Hyper-V and Failover Clustering --"
  Write-Host "----------------------------------------------------------"`n
  Write-Host "Checking Current Status ..."`n

  $WinFeatures = Get-WindowsFeature -Name Hyper-V, Failover-Clustering, Multipath-IO, Telnet-Client

  Write-Host -NoNewline " - Hyper-V Role: "
  $HV = $WinFeatures | Where {$_.Name -eq "Hyper-V"}
  If ($HV.Installed -ne "True") {Write-Host -foregroundColor Red "Not Installed"}
  Else {Write-Host -foregroundColor Green "Installed"}

  Write-Host -NoNewline " - Failover Clustering: "
  $WSFC = $WinFeatures | Where {$_.Name -eq "Failover-Clustering"}
  If ($WSFC.Installed -ne "True") {Write-Host -foregroundColor Red "Not Installed"}
  Else {Write-Host -foregroundColor Green "Installed"}

  Write-Host -NoNewline " - Multipath IO: "
  $MPIO = $WinFeatures | Where {$_.Name -eq "Multipath-IO"}
  If ($MPIO.Installed -ne "True") {Write-Host -foregroundColor Red "Not Installed"}
  Else {Write-Host -foregroundColor Green "Installed"}

  Write-Host -NoNewline " - Telnet Client: "
  $TC = $WinFeatures | Where {$_.Name -eq "Telnet-Client"}
  If ($TC.Installed -ne "True") {Write-Host -foregroundColor Red "Not Installed"`n}
  Else {Write-Host -foregroundColor Green "Installed"`n}

  Do
  {
    Write-Host -NoNewline `n"Install All Required Windows Features? "
    Write-Host -foregroundColor Yellow -NoNewline "[Y]"
    Write-Host -NoNewline " or "
    Write-Host -foregroundColor Yellow -NoNewline "[N]"
    Write-Host -NoNewline ": "
    $InstallWinFeatures = Read-Host
  }
  While ($InstallWinFeatures -ne "Y" -and $InstallWinFeatures -ne "N")

  Switch ($InstallWinFeatures)
  {
    "Y"
    {
      Add-WindowsFeature Telnet-Client,Failover-Clustering,Multipath-IO,Hyper-V -IncludeManagementTools -Verbose
      Write-Host `n`n`n"Completed. System would be required Reboot."
      Write-Host `n"Press Any Key to Continue..."
      $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
    }

    "N"
    {
      Write-Host `n"Canceled."
      Start-Sleep 1
    }
  }
}


Function VirtualNetworks
{
  Do
  {
    Clear-Host
    Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 2"
    Write-Host `n"-------------------------------------------------"
    Write-Host "-- Physical and Virtual Network Configurations --"
    Write-Host "-------------------------------------------------"
    Write-Host `n"1) Rename Network Interfaces"
    Write-Host `n"2) Manage Virtual Switches and Interfaces"
    Write-Host `n"3) Configure IP Addresses (IPv4)"`n

    Do
    {
      Write-Host -NoNewline `n"Select Task "
      Write-Host -foregroundColor Yellow -NoNewline "[ID]"
      Write-Host -NoNewline " or "
      Write-Host -foregroundColor Yellow -NoNewline "[Q]"
      Write-Host -NoNewline "uit: "
      $PnVNetworkConfig = Read-Host
    }
    While ((!$PnVNetworkConfig -or $PnVNetworkConfig -eq 0) -and $PnVNetworkConfig -ne "Q")

    If ($PnVNetworkConfig -eq "Q") {Break}
    
    Switch ($PnVNetworkConfig)
    {
      "1"
      {
        Do
        {
          Clear-Host
          Write-Host `n`n"Retrieving Data. Please Wait..."

          $idx = 0
          $tmpArr = @()
          $NICs = Get-NetAdapter | Sort-Object -Property Name
          $IPs = Get-NetIPAddress | Where {$_.AddressFamily -eq "IPv4"}

          foreach ($Item in $NICs)
          {
            $idx++
            $idxStr = [String]$idx+")"
            $IfName = $Item.Name
            $IfDesc = $Item.InterfaceDescription
            $Speed = $Item.LinkSpeed
            $Status = $Item.Status
            $IPAddress = ""
            $IfIPConfig = Get-NetIPInterface | Where {$_.InterfaceAlias -eq $IfName}

            If ($IfIPConfig.Dhcp -eq "Enabled") {$IPAddress = "DHCP"}
            ElseIf (! $IfIPConfig) {$IPAddress = "N/A"}
            Else
            {
              foreach ($Item1 in $IPs)
              {
                If ($Item1.InterfaceIndex -eq $Item.InterfaceIndex) {$IPAddress = $Item1.IPAddress+"/"+$Item1.PrefixLength}
              }
            }

            $Output = New-Object PSObject
            $Output | Add-Member Noteproperty Index $idxStr
            $Output | Add-Member Noteproperty Name $IfName
            $Output | Add-Member Noteproperty Description $IfDesc
            $Output | Add-Member Noteproperty "IP Address" $IPAddress
            $Output | Add-Member Noteproperty Speed $Speed
            $Output | Add-Member Noteproperty Status $Status
            $tmpArr += $Output
          }

          Clear-Host
          Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 3"
          Write-Host `n"-------------------------------"
          Write-Host "-- Rename Network Interfaces --"
          Write-Host "-------------------------------"
          $tmpArr | ft -AutoSize

          Do
          {
            Write-Host -NoNewline `n"Select Interface "
            Write-Host -foregroundColor Yellow -NoNewline "[ID]"
            Write-Host -NoNewline " or "
            Write-Host -foregroundColor Yellow -NoNewline "[Q]"
            Write-Host -NoNewline "uit: "
            $RenameNIC = Read-Host
          }
          While ((!$RenameNIC -or $RenameNIC -eq 0) -and $RenameNIC -ne "Q")

          If ($RenameNIC -eq "Q") {Break}

          $RenameNIC = [Int]$RenameNIC-1
          $NewName = Read-Host `n`n"New Name for the Network Interface (Blank: Cancel)"
          If (! $NewName) {Write-Host `n"Canceled."}
          Else
          {
            $NICs[$RenameNIC] | Rename-NetAdapter -NewName $NewName
            Write-Host `n"Done."
          }
          Start-Sleep 1
        }
        While ($True)
      }

      "2"
      {
        Do
        {
          Clear-Host
          Write-Host `n`n"Retrieving Data. Please Wait..."

          $idx = 0
          $tmpArr = @()
          $NICs = Get-NetAdapter
          $VSW = Get-VMSwitch

          If (! $VSW) {Write-Host `n`n"There is no Virtual Switch."`n`n}
          Else
          {
            foreach ($Item in $VSW)
            {
              $idx++
              $idxStr = [String]$idx+")"
              $UpNIC = $NICs | Where {$_.InterfaceDescription -eq $Item.NetAdapterInterfaceDescription}
              $Output = New-Object PSObject
              $Output | Add-Member Noteproperty Index $idxStr
              $Output | Add-Member Noteproperty "Switch Name" $Item.Name
              $Output | Add-Member Noteproperty "Switch Type" $Item.SwitchType
              $Output | Add-Member Noteproperty "QoS Mode" $Item.BandwidthReservationMode
              $Output | Add-Member Noteproperty "QoS Default Weight" $Item.DefaultFlowMinimumBandwidthWeight
              $Output | Add-Member Noteproperty "Default Bandwidth %" $Item.BandwidthPercentage
              $Output | Add-Member Noteproperty "NIC Name" $UpNIC.Name
              $Output | Add-Member Noteproperty "NIC Description" $UpNIC.InterfaceDescription
              $Output | Add-Member Noteproperty "NIC Speed" $UpNIC.LinkSpeed
              $Output | Add-Member Noteproperty "NIC Status" $UpNIC.Status
              $tmpArr += $Output
            }

            Clear-Host
            Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 3"
            Write-Host `n"--------------------------------------------"
            Write-Host "-- Manage Virtual Switches and Interfaces --"
            Write-Host "--------------------------------------------"
            $tmpArr | ft Index,"Switch Name","Switch Type","NIC Name","NIC Description","NIC Speed","NIC Status" -AutoSize

            Do
            {
              Write-Host -NoNewline `n"Select Virtual Switch "
              Write-Host -foregroundColor Yellow -NoNewline "[ID]"
              Write-Host -NoNewline ", Create "
              Write-Host -foregroundColor Yellow -NoNewline "[N]"
              Write-Host -NoNewline "ew Virtual Switch or "
              Write-Host -foregroundColor Yellow -NoNewline "[Q]"
              Write-Host -NoNewline "uit: "
              $ManageVSWnIf = Read-Host
            }
            While ((!$ManageVSWnIf -or $ManageVSWnIf -eq 0) -and $ManageVSWnIf -ne "N" -and $ManageVSWnIf -ne "Q")
            If ($ManageVSWnIf -eq "Q") {Break}

            If ($ManageVSWnIf -eq "N")
            {
              Do
              {
                Clear-Host
                Write-Host `n`n"Searching for Available Network Interfaces. Please Wait..."

                $idx = 0
                $tmpArr = @()
                $IPs = Get-NetIPAddress | Where {$_.AddressFamily -eq "IPv4"}
                $HostNIC = Get-VMNetworkAdapter -ManagementOS
                $NICs = Get-NetAdapterBinding | Where {$_.ComponentID -eq "ms_tcpip" -and $_.Enabled -eq "True"} | Get-NetAdapter | Sort-Object -Property Name

                foreach ($Item in $NICs)
                {
                  $isAvail = 1
                  foreach ($Item1 in $HostNIC)
                  {
                    $tmpMAC = $Item.MacAddress.Replace("-","")
                    If ($tmpMAC -eq $Item1.MacAddress) {$isAvail = 0}
                  }

                  If ($isAvail -eq 1)
                  {
                    $idx++
                    $idxStr = [String]$idx+")"
                    $IPAddress = ""
                    foreach ($Item3 in $IPs)
                    {
                      If ($Item3.InterfaceIndex -eq $Item.InterfaceIndex) {$IPAddress = $Item3.IPAddress+"/"+$Item3.PrefixLength}
                    }
                    $Output = New-Object PSObject
                    $Output | Add-Member Noteproperty Index $idxStr
                    $Output | Add-Member Noteproperty Name $Item.Name
                    $Output | Add-Member Noteproperty Description $Item.InterfaceDescription
                    $Output | Add-Member Noteproperty "IP Address" $IPAddress
                    $Output | Add-Member Noteproperty Speed $Item.LinkSpeed
                    $Output | Add-Member Noteproperty Status $Item.Status
                    $tmpArr += $Output
                  }
                }

                Clear-Host
                Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 4"
                Write-Host `n"-------------------------------"
                Write-Host "-- Create New Virtual Switch --"
                Write-Host "-------------------------------"

                $tmpArr | ft -AutoSize

                Do
                {
                  Write-Host -NoNewline `n"Select Interface "
                  Write-Host -foregroundColor Yellow -NoNewline "[ID]"
                  Write-Host -NoNewline " or "
                  Write-Host -foregroundColor Yellow -NoNewline "[Q]"
                  Write-Host -NoNewline "uit: "
                  $CreateVSW = Read-Host
                }
                While ((!$CreateVSW -or $CreateVSW -eq 0) -and $CreateVSW -ne "Q")
                
                If ($CreateVSW -eq "Q") {Break}

                $CreateVSW = [Int]$CreateVSW-1
                $NICName = $tmpArr[$CreateVSW].Name

                $VSWName = Read-Host `n"New Virtual Switch Name (Blank: Cancel)"
                If (! $VSWName)
                {
                  Write-Host `n"Canceled."
                  Start-Sleep 1
                  Break
                }

                Write-Host `n"Creating a New Virtual Switch. Please Wait..."
                $CreateVWS = New-VMSwitch -Name $VSWName -NetAdapterName $NICName -AllowManagementOS $False -MinimumBandwidthMode Weight
                $SetVSWBW = $CreateVWS | Set-VMSwitch -DefaultFlowMinimumBandwidthWeight 10
                $CreateVWS = Get-VMSwitch -Name $VSWName
                $CreateVWS | fl *
                Write-Host `n"Creation Succeeded."
                Write-Host `n"Press Any Key to Continue..."
                $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
                Break
              }
              While ($True)
            }

            If ($ManageVSWnIf -ne "N" -and $ManageVSWnIf -ne "Q")
            {
              $ManageVSWnIf = [Int]$ManageVSWnIf-1
              $VSWName = $tmpArr[$ManageVSWnIf]."Switch Name"

              Do
              {
                Clear-Host
                $SelectedVSW = Get-VMSwitch | Where {$_.Name -eq $VSWName}
                If (! $SelectedVSW) {Break}

                Write-Host `n`n"Retrieving Data. Please Wait..."
                $VSWType = $SelectedVSW.SwitchType
                $VSWQoSMode = $SelectedVSW.BandwidthReservationMode
                $VSWDefaultQoS = $SelectedVSW.DefaultFlowMinimumBandwidthWeight
                $VSWDefaultPerc = $SelectedVSW.BandwidthPercentage
                $VSWNICDesc = $SelectedVSW.NetAdapterInterfaceDescription

                $VSWNIC = Get-NetAdapter | Where {$_.InterfaceDescription -eq $VSWNICDesc}
                $VSWNICName = $VSWNIC.Name
                $VSWNICSpeed = $VSWNIC.LinkSpeed
                $VSWNICStatus = $VSWNIC.Status
                $vNIC = Get-VMNetworkAdapter -ManagementOS -SwitchName $VSWName -ErrorAction SilentlyContinue
                $VSWvNIC = $vNIC.Count

                Clear-Host
                Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 4"
                Write-Host `n"-----------------------------"
                Write-Host "-- Selected Virtual Switch --"
                Write-Host "-----------------------------"
                Write-Host `n" - Name: "$VSWName
                Write-Host `n" - Type: "$VSWType
                Write-Host `n" - QoS Mode: "$VSWQoSMode
                Write-Host `n" - QoS Default Weight: "$VSWDefaultQoS
                Write-Host `n" - Default Bandwidth: "$VSWDefaultPerc" %"
                Write-Host `n" - NIC Name: "$VSWNICName
                Write-Host `n" - NIC Description: "$VSWNICDesc
                Write-Host `n" - Link Speed: "$VSWNICSpeed
                Write-Host `n" - Link Status: "$VSWNICStatus
                Write-Host `n" - # of Management vNIC: "$VSWvNIC`n

                Do
                {
                  Write-Host -NoNewline `n"Re"
                  Write-Host -foregroundColor Yellow -NoNewline "[N]"
                  Write-Host -NoNewline "ame, "
                  Write-Host -foregroundColor Yellow -NoNewline "[R]"
                  Write-Host -NoNewline "emove, "
                  Write-Host -foregroundColor Yellow -NoNewline "[C]"
                  Write-Host -NoNewline "hange Default Weight or "
                  Write-Host -foregroundColor Yellow -NoNewline "[M]"
                  Write-Host -NoNewline "anage vNIC (Blank: Cancel): "
                  $VSWTask = Read-Host
                }
                While ($VSWTask -ne "N" -and $VSWTask -ne "R" -and $VSWTask -ne "M" -and $VSWTask -ne "C" -and $VSWTask -ne "")

                If ($VSWTask -eq "")
                {
                  Write-Host `n"Canceled."
                  Start-Sleep 1
                  Break
                }

                Switch ($VSWTask)
                {
                  "N"
                  {
                    $NewVSWName = Read-Host `n"New Virtual Switch Name"
                    If ($NewVSWName -ne "")
                    {
                      $SelectedVSW | Rename-VMSwitch -NewName $NewVSWName
                      $VSWName = $NewVSWName
                      Write-Host `n"Done."
                    }
                    Else
                    {
                      Write-Host `n"Nothing Changed."
                    }
                    Start-Sleep 1
                  }

                  "R"
                  {
                    Do
                    {
                      $VSWtoRemove = $SelectedVSW.Name
                      Write-Host -NoNewline `n"Removing Virtual Switch "
                      Write-Host -NoNewLine -foregroundColor Red $VSWtoRemove
                      Write-Host "."
                      Write-Host -NoNewLine "Are You Sure ? "
                      Write-Host -foregroundColor Yellow -NoNewline "[Y]"
                      Write-Host -NoNewline " or "
                      Write-Host -foregroundColor Yellow -NoNewline "[N]"
                      Write-Host -NoNewline ": "
                      $AUSure = Read-Host
                    }
                    While ($AUSure -ne "Y" -and $AUSure -ne "N")

                    If ($AUSure -eq "Y")
                    {
                      Write-Host `n`n"Removing Virtual Switch. Please Wait..."
                      $SelectedVSW | Remove-VMSwitch -Force
                      Write-Host `n"Done."
                      Start-Sleep 1
                      Break
                    }
                  }

                  "C"
                  {
                    $NewQoSValue = Read-Host `n"New Value of QoS Default Weight (1-100) (Blank: Cancel)"

                    If (! $NewQoSValue)
                    {
                      Write-Host `n"Canceled."
                      Start-Sleep 1
                    }
                    Else
                    {
                      $SelectedVSW | Set-VMSwitch -DefaultFlowMinimumBandwidthWeight $NewQoSValue
                      Write-Host `n"Done."
                      Start-Sleep 1
                    }
                  }

                  "M"
                  {
                    $SelSWName = $SelectedVSW.Name
                    Do
                    {
                      Clear-Host
                      Write-Host `n`n"Retrieving Data. Please Wait..."

                      $SelectedVSW = Get-VMSwitch | Where {$_.Name -eq $SelSWName}
                      If (! $SelectedVSW) {Break}

                      $IndexNum = 0
                      $tmpArr = @()
                      $VSWvNIC = Get-VMNetworkAdapter -ManagementOS -SwitchName $SelSWName -ErrorAction SilentlyContinue
                      foreach ($vNI in $VSWvNIC)
                      {
                        $IndexNum++
                        $IndexStr = [String]$IndexNum+")"
                        $VLANConfig = $vNI.VlanSetting
                        $BWConfig = $vNI.BandwidthSetting

                        $vNICName = $vNI.Name
                        $vNICVLANMode = $VLANConfig.OperationMode
                        $vNICAccessVLANID = $VLANConfig.AccessVlanId
                        $vNICMinBandWeight = $BWConfig.MinimumBandwidthWeight
                        $vNICBandPercentage = $vNI.BandwidthPercentage
                        $Output = New-Object PSObject
                        $Output | Add-Member Noteproperty Index $IndexStr
                        $Output | Add-Member Noteproperty Name $vNICName
                        $Output | Add-Member Noteproperty "VLANMode" $vNICVLANMode
                        $Output | Add-Member Noteproperty "VLAN ID(Access)" $vNICAccessVLANID
                        $Output | Add-Member Noteproperty "MinimumBandwidthWeight" $vNICMinBandWeight
                        $Output | Add-Member Noteproperty "BandwidthPercentage" $vNICBandPercentage
                        $tmpArr += $Output
                      }

                      Clear-Host
                      Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 5"
                      Write-Host `n"---------------------------------------"
                      Write-Host "-- Manage Virtual Network Interfaces --"
                      Write-Host -NoNewLine "-- Selected Virtual Switch: "
                      Write-Host -ForegroundColor Green $SelSWName
                      Write-Host "---------------------------------------"

                      If (! $VSWvNIC)
                      {
                        Write-Host `n"There is no Virtual Network Interface."
                        Do
                        {
                          Write-Host -NoNewline `n"Add New Virtual Network Interface? "
                          Write-Host -foregroundColor Yellow -NoNewline "[Y]"
                          Write-Host -NoNewline " or "
                          Write-Host -foregroundColor Yellow -NoNewline "[N]"
                          Write-Host -NoNewline ": "
                          $AddvNIC = Read-Host
                        }
                        While ($AddvNIC -ne "Y" -and $AddvNIC -ne "N")

                        If ($AddvNIC -eq "Y")
                        {
                          $NewNICName = Read-Host `n`n"Interface Name (Blank: Cancel)"
                          
                          If (! $NewNICName)
                          {
                            Write-Host `n"Canceled."
                            Start-Sleep 1
                            Break
                          }
                          Else
                          {
                            $NewNICMinBand = Read-Host `n"Minimum Bandwidth Weight (0-100)"
                            $NewNICVlanID = Read-Host `n"VLAN ID (Blank: No VLAN)"

                            Write-Host `n`n"Creating Virtual Network Interface. Please Wait..."
                            Add-VMNetworkAdapter -ManagementOS -Name $NewNICName -SwitchName $SelSWName
                            Set-VMNetworkAdapter -ManagementOS -Name $NewNICName -MinimumBandwidthWeight $NewNICMinBand

                            If ($NewNICVlanID)
                            {Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName $NewNICName -Access -VlanId $NewNICVlanID}
                            Else {Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName $NewNICName -Untagged}
                            Write-Host `n"Creation Succeeded."
                            Start-Sleep 1
                          }
                        }
                        Else {Break}
                      }
                      Else
                      {
                        $tmpArr | ft -AutoSize
                        Do
                        {
                          Write-Host -foregroundColor Yellow -NoNewline `n"[A]"
                          Write-Host -NoNewline "dd, "
                          Write-Host -foregroundColor Yellow -NoNewline "[R]"
                          Write-Host -NoNewline "emove, "
                          Write-Host -foregroundColor Yellow -NoNewline "[M]"
                          Write-Host -NoNewline "odify Interface or "
                          Write-Host -foregroundColor Yellow -NoNewline "[Q]"
                          Write-Host -NoNewline "uit: "
                          $vNICTask = Read-Host
                        }
                        While ($vNICTask -ne "A" -and $vNICTask -ne "R" -and $vNICTask -ne "M" -and $vNICTask -ne "Q")

                        If ($vNICTask -eq "Q") {Break}

                        Switch ($vNICTask)
                        {
                          "A"
                          {
                            $NewNICName = Read-Host `n`n"Interface Name (Blank: Cancel)"
                            If (! $NewNICName)
                            {
                              Write-Host `n"Canceled."
                              Start-Sleep 1
                              Break
                            }

                            $NewNICMinBand = Read-Host `n"Minimum Bandwidth Weight (0-100)"
                            $NewNICVlanID = Read-Host `n"VLAN ID (Blank: No VLAN)"
                            Write-Host `n`n"Creating Virtual Network Interface. Please Wait..."
                            Add-VMNetworkAdapter -ManagementOS -Name $NewNICName -SwitchName $SelSWName
                            Set-VMNetworkAdapter -ManagementOS -Name $NewNICName -MinimumBandwidthWeight $NewNICMinBand

                            If ($NewNICVlanID)
                            {Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName $NewNICName -Access -VlanId $NewNICVlanID}
                            Else {Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName $NewNICName -Untagged}
                            Write-Host `n"Creation Succeeded."
                            Start-Sleep 1
                          }

                          "R"
                          {
                            Write-Host -NoNewLine `n`n"Interface "
                            Write-Host -NoNewLine -foregroundColor Yellow "[ID] "
                            Write-Host -NoNewLine "(Blank: Cancel): "
                            $vNICtoRemove = Read-Host

                            If ($vNICtoRemove)
                            {
                              $vNICtoRemove = [Int]$vNICtoRemove-1
                              $vNICtoRemoveName = $tmpArr[$vNICtoRemove].Name
                              Do
                              {
                                Write-Host -NoNewLine `n"Removing Virtual Network Interface "
                                Write-Host -NoNewLine -foregroundColor Red $vNICtoRemoveName
                                Write-Host "."
                                Write-Host -NoNewLine "Are You Sure ? "
                                Write-Host -NoNewLine -foregroundColor Yellow "[Y]"
                                Write-Host -NoNewLine " or "
                                Write-Host -NoNewLine -foregroundColor Yellow "[N]"
                                Write-Host -NoNewLine ": "
                                $ConfirmRemovevNIC = Read-Host
                              }
                              While ($ConfirmRemovevNIC -ne "Y" -and $ConfirmRemovevNIC -ne "N")

                              If ($ConfirmRemovevNIC -eq "Y")
                              {
                                Remove-VMNetworkAdapter -ManagementOS -Name $vNICtoRemoveName
                                Write-Host `n"Removed."
                                Start-Sleep 1
                              }
                              Else
                              {
                                Write-Host `n"Canceled."
                                Start-Sleep 1
                              }
                            }
                            Else
                            {
                              Write-Host `n"Canceled."
                              Start-Sleep 1
                            }
                          }

                          "M"
                          {
                            Write-Host -NoNewLine `n`n"Interface "
                            Write-Host -NoNewLine -foregroundColor Yellow "[ID] "
                            Write-Host -NoNewLine "(Blank: Cancel): "
                            $vNICtoModify = Read-Host
                            If ($vNICtoModify)
                            {
                              $vNICtoModify = [Int]$vNICtoModify-1
                              $vNICtoModifyName = $tmpArr[$vNICtoModify].Name
                              Write-Host -NoNewLine `n"Selected Interface is "
                              Write-Host -NoNewLine -foregroundColor Green $vNICtoModifyName
                              Write-Host "."

                              Do
                              {
                                Write-Host -NoNewLine `n"Modify "
                                Write-Host -NoNewLine -foregroundColor Yellow "[V]"
                                Write-Host -NoNewLine "LAN or "
                                Write-Host -NoNewLine -foregroundColor Yellow "[B]"
                                Write-Host -NoNewLine "andwidth Weight: "
                                $vNICModifyTask = Read-Host
                              }
                              While ($vNICModifyTask -ne "V" -and $vNICModifyTask -ne "B")

                              Switch ($vNICModifyTask)
                              {
                                "V"
                                {
                                  $NewVlanID = Read-Host `n"VLAN ID (Blank: No VLAN)"
                                  Write-Host `n`n"Modifing Virtual Network Interface. Please Wait..."
                                  If ($NewVlanID)
                                  {Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName $vNICtoModifyName -Access -VlanId $NewVlanID}
                                  Else {Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName $vNICtoModifyName -Untagged}
                                  Write-Host `n"Done."
                                  Start-Sleep 1
                                }

                                "B"
                                {
                                  $NewBW = Read-Host `n"Minimum Bandwidth Weight (0-100)"
                                  Write-Host `n`n"Modifing Virtual Network Interface. Please Wait..."
                                  Set-VMNetworkAdapter -ManagementOS -Name $vNICtoModifyName -MinimumBandwidthWeight $NewBW
                                  Write-Host `n"Done."
                                  Start-Sleep 1
                                }
                              }
                            }
                            Else
                            {
                              Write-Host `n"Canceled."
                              Start-Sleep 1
                            }
                          }
                        }
                      }
                    }
                    While ($True)
                  }
                }
              }
              While ($True)
            }
          }

          If (! $VSW)
          {
            Do
            {
              Write-Host -NoNewline `n"Create New Virtual Switch? "
              Write-Host -foregroundColor Yellow -NoNewline "[Y]"
              Write-Host -NoNewline " or "
              Write-Host -foregroundColor Yellow -NoNewline "[N]"
              Write-Host -NoNewline ": "
              $CreateNewVSW = Read-Host
            }
            While ($CreateNewVSW -ne "Y" -and $CreateNewVSW -ne "N")

            If ($CreateNewVSW -eq "N") {Break}
            Else
            {
              Do
              {
                Clear-Host
                Write-Host `n`n"Searching for Available Network Interfaces. Please Wait..."

                $idx = 0
                $tmpArr = @()
                $IPs = Get-NetIPAddress | Where {$_.AddressFamily -eq "IPv4"}
                $HostNIC = Get-VMNetworkAdapter -ManagementOS
                $NICs = Get-NetAdapterBinding | Where {$_.ComponentID -eq "ms_tcpip" -and $_.Enabled -eq "True"} | Get-NetAdapter | Sort-Object -Property Name

                foreach ($Item in $NICs)
                {
                  $isAvail = 1
                  foreach ($Item1 in $HostNIC)
                  {
                    $tmpMAC = $Item.MacAddress.Replace("-","")
                    If ($tmpMAC -eq $Item1.MacAddress)
                    {
                      $isAvail = 0
                    }
                  }

                  If ($isAvail -eq 1)
                  {
                    $idx++
                    $idxStr = [String]$idx+")"
                    $IPAddress = ""
                    foreach ($Item3 in $IPs)
                    {
                      If ($Item3.InterfaceIndex -eq $Item.InterfaceIndex) {$IPAddress = $Item3.IPAddress+"/"+$Item3.PrefixLength}
                    }
                    $Output = New-Object PSObject
                    $Output | Add-Member Noteproperty Index $idxStr
                    $Output | Add-Member Noteproperty Name $Item.Name
                    $Output | Add-Member Noteproperty Description $Item.InterfaceDescription
                    $Output | Add-Member Noteproperty "IP Address" $IPAddress
                    $Output | Add-Member Noteproperty Speed $Item.LinkSpeed
                    $Output | Add-Member Noteproperty Status $Item.Status
                    $tmpArr += $Output
                  }
                }

                Clear-Host
                Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 4"
                Write-Host `n"-------------------------------"
                Write-Host "-- Create New Virtual Switch --"
                Write-Host "-------------------------------"
                $tmpArr | ft -AutoSize
                
                Do
                {
                  Write-Host -NoNewline "Select Interface "
                  Write-Host -foregroundColor Yellow -NoNewline "[ID]"
                  Write-Host -NoNewline " or "
                  Write-Host -foregroundColor Yellow -NoNewline "[Q]"
                  Write-Host -NoNewline "uit: "
                  $CreateNewVSNIC = Read-Host
                }
                While ((!$CreateNewVSNIC -or $CreateNewVSNIC -eq 0) -and $CreateNewVSNIC -ne "Q")

                If ($CreateNewVSNIC -eq "Q") {Break}

                $CreateNewVSNIC = [Int]$CreateNewVSNIC-1
                $NICName = $tmpArr[$CreateNewVSNIC].Name
                $VSWName = Read-Host `n"New Virtual Switch Name (Blank: Cancel)"
                If (! $VSWName)
                {
                  Write-Host `n"Canceled."
                  Start-Sleep 1
                  Break
                }

                Write-Host `n"Creating a New Virtual Switch. Please Wait..."
                $CreateVWS = New-VMSwitch -Name $VSWName -NetAdapterName $NICName -AllowManagementOS $False -MinimumBandwidthMode Weight
                $SetVSWBW = $CreateVWS | Set-VMSwitch -DefaultFlowMinimumBandwidthWeight 10
                $CreateVWS = Get-VMSwitch -Name $VSWName
                $CreateVWS | fl *
                Write-Host `n"Creation Succeeded."
                Write-Host `n"Press Any Key to Continue..."
                $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
                Break
              }
              While ($True)
            }
          }
        }
        While ($True)
      }

      "3"
      {
        Do
        {
          Clear-Host
          Write-Host `n`n"Retrieving Data. Please Wait..."

          $idx = 0
          $tmpArr = @()
          $NICs = Get-NetAdapterBinding | Where {$_.ComponentID -eq "ms_tcpip" -and $_.Enabled -eq "True"} | Get-NetAdapter | Sort-Object -Property Name
          $IPs = Get-NetIPAddress | Where {$_.AddressFamily -eq "IPv4"}

          foreach ($Item in $NICs)
          {
            $idx++
            $idxStr = [String]$idx+")"
            $IfName = $Item.Name
            $IfDesc = $Item.InterfaceDescription
            $Speed = $Item.LinkSpeed
            $Status = $Item.Status
            $IPAddress = ""
            $IfIPConfig = Get-NetIPInterface | Where {$_.InterfaceAlias -eq $IfName}

            If ($IfIPConfig.Dhcp -eq "Enabled") {$IPAddress = "DHCP"}
            ElseIf (! $IfIPConfig) {$IPAddress = "N/A"}
            Else
            {
              foreach ($Item1 in $IPs)
              {
                If ($Item1.InterfaceIndex -eq $Item.InterfaceIndex) {$IPAddress = $Item1.IPAddress+"/"+$Item1.PrefixLength}
              }
            }
            $Output = New-Object PSObject
            $Output | Add-Member Noteproperty Index $idxStr
            $Output | Add-Member Noteproperty Name $IfName
            $Output | Add-Member Noteproperty Description $IfDesc
            $Output | Add-Member Noteproperty "IP Address" $IPAddress
            $Output | Add-Member Noteproperty Speed $Speed
            $Output | Add-Member Noteproperty Status $Status
            $tmpArr += $Output
          }

          Clear-Host
          Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 3"
          Write-Host `n"-----------------------------------"
          Write-Host "-- Configure IP Addresses (IPv4) --"
          Write-Host "-----------------------------------"
          $tmpArr | ft -AutoSize

          Do
          {
            Write-Host -NoNewline `n"Select Interface "
            Write-Host -foregroundColor Yellow -NoNewline "[ID]"
            Write-Host -NoNewline " or "
            Write-Host -foregroundColor Yellow -NoNewline "[Q]"
            Write-Host -NoNewline "uit: "
            $ConfigIP4NIC = Read-Host
          }
          While ((!$ConfigIP4NIC -or $ConfigIP4NIC -eq 0) -and $ConfigIP4NIC -ne "Q")

          If ($ConfigIP4NIC -eq "Q") {Break}

          $ConfigIP4NIC = [Int]$ConfigIP4NIC-1
          Do
          {
            Clear-Host

            $NIC = $NICs[$ConfigIP4NIC]
            $IfName = $NIC.Name
            $IfDesc = $NIC.InterfaceDescription
            $Speed = $NIC.LinkSpeed
            $Status = $NIC.Status
            $DNS = $NIC | Get-DnsClientServerAddress -AddressFamily IPv4
            $DNS = [String]$DNS.ServerAddresses
            $IPAddress = ""
            $IfIPConfig = Get-NetIPInterface | Where {$_.InterfaceAlias -eq $IfName}

            If ($IfIPConfig.Dhcp -eq "Enabled") {$IPAddress = "DHCP"}
            ElseIf (! $IfIPConfig) {$IPAddress = "N/A"}
            Else
            {
              foreach ($Item1 in $IPs)
              {
                If ($Item1.InterfaceIndex -eq $NIC.InterfaceIndex) {$IPAddress = $Item1.IPAddress+"/"+$Item1.PrefixLength}
              }
            }
            Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 4"
            Write-Host `n"------------------------"
            Write-Host "-- Selected Interface --"
            Write-Host "------------------------"
            Write-Host `n" - Name: "$IfName
            Write-Host `n" - Description: "$IfDesc
            Write-Host `n" - IP Address: "$IPAddress
            Write-Host `n" - DNS Servers: "$DNS
            Write-Host `n" - Speed: "$Speed
            Write-Host `n" - Status: "$Status`n

            Do
            {
              Write-Host -foregroundColor Yellow -NoNewline `n"[D]"
              Write-Host -NoNewline "HCP or "
              Write-Host -foregroundColor Yellow -NoNewline "[S]"
              Write-Host -NoNewline "tatic (Blank: Cancel): "
              $IPType = Read-Host
            }
            While ($IPType -ne "D" -and $IPType -ne "S" -and $IPType -ne "")

            If (! $IPType)
            {
              Write-Host `n"Canceled."
              Start-Sleep 1
              Break
            }
            ElseIf ($IPType -eq "D")
            {
              $NIC | Remove-NetIPAddress -Confirm:$False -ErrorAction SilentlyContinue
              $NIC | Remove-NetRoute -Confirm:$False -ErrorAction SilentlyContinue
              $NIC | Set-NetIPInterface -Dhcp Enabled
              $NIC | Set-DnsClientServerAddress -ResetServerAddresses
              Write-Host `n"Done."
              Start-Sleep 1
              Break
            }

            $IP = Read-Host `n"New IP Address (Blank: Cancel)"
            If (! $IP)
            {
              Write-Host `n"Canceled."
              Start-Sleep 1
              Break
            }

            $ArrIP = $IP.Split(".")
            $IPClass = [int]$ArrIP[0]
            If ($IPClass -ge 0 -and $IPClass -le 127) {$DefaultSubnet = "255.0.0.0"}
            ElseIf ($IPClass -ge 128 -and $IPClass -le 191) {$DefaultSubnet = "255.255.0.0"}
            ElseIf ($IPClass -ge 192 -and $IPClass -le 224) {$DefaultSubnet = "255.255.255.0"}
            Else {$DefaultSubnet = "255.255.255.255"}
            $Mask = Read-Host `n"Subnet Mask (Default: "$DefaultSubnet")"
            If (! $Mask) {$Mask = $DefaultSubnet}
            $GW = Read-Host `n"Default Gateway (Optional)"

            $ArrMask = $Mask.Split(".")
            $PrefixLen = ""
            foreach ($MaskItem in $ArrMask)
            {
              $tmpPrefix = [Convert]::ToString([int32]$MaskItem,2)
              $PrefixLen = $PrefixLen + $tmpPrefix
            }
            $PrefixLen = $PrefixLen.Replace("0","")
            $PrefixLen = $PrefixLen.Length

            $NIC | Remove-NetIPAddress -Confirm:$False -ErrorAction SilentlyContinue
            $NIC | Remove-NetRoute -Confirm:$False -ErrorAction SilentlyContinue
            $NIC | Set-DnsClientServerAddress -ResetServerAddresses

            If (! $GW) {$tmp = $NIC | New-NetIPAddress -IPAddress $IP -PrefixLength $PrefixLen}
            Else {$tmp = $NIC | New-NetIPAddress -IPAddress $IP -PrefixLength $PrefixLen -DefaultGateway $GW}

            Write-Host `n"Done."`n
            Start-Sleep 1

            $DNSIP1 = Read-Host `n"Primary DNS Server IP Address (Optional)"
            If (! $DNSIP1) {Break}
            $DNSIP2 = Read-Host `n"Secondary DNS Server IP Address (Optional)"
            If (! $DNSIP2) {$NIC | Set-DnsClientServerAddress -ServerAddresses $DNSIP1}
            Else {$NIC | Set-DnsClientServerAddress -ServerAddresses $DNSIP1,$DNSIP2}

            Write-Host `n"Done."
            Start-Sleep 1
            Break
          }
          While ($True)
        }
        While ($True)
      }
    }
  }
  While ($True)
}


Function JumboFrame
{
  Do
  {
    Clear-Host
    Write-Host `n`n"Retrieving Data. Please Wait..."

    $NICs = Get-NetAdapterAdvancedProperty | Where {$_.RegistryKeyword -like "*JumboPacket"} | Sort-Object -Property Name
    $idx = 0
    $tmpArr = @()
    foreach ($Item in $NICs)
    {
      $idx++
      $idxStr = [String]$idx+")"
      $Interface = $Item | Get-NetAdapter

      $Output = New-Object PSObject
      $Output | Add-Member Noteproperty Index $idxStr
      $Output | Add-Member Noteproperty Name $Item.Name
      $Output | Add-Member Noteproperty Description $Interface.InterfaceDescription
      $Output | Add-Member Noteproperty SetValue $Item.DisplayValue
      $Output | Add-Member Noteproperty Speed $Interface.LinkSpeed
      $Output | Add-Member Noteproperty Status $Interface.Status
      $tmpArr += $Output
    }
    Clear-Host
    Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 2"
    Write-Host `n"--------------------------------------------"
    Write-Host "-- Network Interface Jumbo Frame Settings --"
    Write-Host "--------------------------------------------"
    $tmpArr| ft -AutoSize

    Do
    {
      Write-Host -NoNewline `n"Select Interface "
      Write-Host -foregroundColor Yellow -NoNewline "[ID]"
      Write-Host -NoNewline ", Ping "
      Write-Host -foregroundColor Yellow -NoNewline "[T]"
      Write-Host -NoNewline "est or "
      Write-Host -foregroundColor Yellow -NoNewline "[Q]"
      Write-Host -NoNewline "uit: "
      $NICJumboSet = Read-Host
    }
    While (!$NICJumboSet)
    
    If ($NICJumboSet -eq "T")
    {
      $tmpTargetIP = Read-Host `n`n"Target IP Address (Blank: Cancel)"
      If (!$tmpTargetIP)
      {
        Write-Host `n"Canceled."
        Start-Sleep 1
      }
      Else
       {
          $PingCmd = "Ping -f -l 8000 "+$tmpTargetIP
          Invoke-Expression -Command $PingCmd
          Write-Host `n`n"Press Any Key to Continue..."
          $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
       }
    }
    
    Clear-Host
    If ($NICJumboSet -eq "Q") {Break}

    $NICJumboSet = [Int]$NICJumboSet-1
    If ($Error) {$Error.Clear()}
    Else
    {
      Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 3"
      Write-Host `n"------------------------"
      Write-Host "-- Selected Interface --"
      Write-Host "------------------------"

      $Interface = $NICs[$NICJumboSet] | Get-NetAdapter
      $tmpArr = @()

      $Output = New-Object PSObject
      $Output | Add-Member Noteproperty Name $NICs[$NICJumboSet].Name
      $Output | Add-Member Noteproperty Description $Interface.InterfaceDescription
      $Output | Add-Member Noteproperty ConfigName $NICs[$NICJumboSet].DisplayName
      $Output | Add-Member Noteproperty SetValue $NICs[$NICJumboSet].DisplayValue
      $tmpArr += $Output
      $tmpArr| ft -AutoSize

      Do
      {
        Write-Host -foregroundColor Yellow -NoNewline `n"[E]"
        Write-Host -NoNewline "nable or "
        Write-Host -foregroundColor Yellow -NoNewline "[D]"
        Write-Host -NoNewline "isable Jumbo Frame (Blank: Cancel): "
        $EnableJumbo = Read-Host
      }
      While ($EnableJumbo -ne "E" -and $EnableJumbo -ne "D" -and $EnableJumbo -ne "")

      Switch ($EnableJumbo)
      {
        "E"
        {
          If ($NICs[$NICJumboSet].DisplayParameterType -eq 1)
          {
            $NICs[$NICJumboSet] | Set-NetAdapterAdvancedProperty -RegistryKeyword "*JumboPacket" -Registryvalue 9000
            Write-Host `n"Done."
            Start-Sleep 1
          }
          ElseIf ($NICs[$NICJumboSet].DisplayParameterType -eq 5)
          {
            $NICs[$NICJumboSet] | Set-NetAdapterAdvancedProperty -RegistryKeyword "*JumboPacket" -Registryvalue 9014
            Write-Host `n"Done."
            Start-Sleep 1
          }
        }

        "D"
        {
          If ($NICs[$NICJumboSet].DisplayParameterType -eq 1)
          {
            $NICs[$NICJumboSet] | Set-NetAdapterAdvancedProperty -RegistryKeyword "*JumboPacket" -Registryvalue 1500
            Write-Host `n"Done."
            Start-Sleep 1
          }
          ElseIf ($NICs[$NICJumboSet].DisplayParameterType -eq 5)
          {
            $NICs[$NICJumboSet] | Set-NetAdapterAdvancedProperty -RegistryKeyword "*JumboPacket" -Registryvalue 1514
            Write-Host `n"Done."
            Start-Sleep 1
          }
        }
        
        Default
        {
          Write-Host `n"Canceled."
          Start-Sleep 1
          Break
        }
      }
    }
  }
  While ($True)
}



#---------------------------------------------------#
#------------------- Script Main -------------------#
#---------------------------------------------------#
$UI = (Get-Host).UI.RawUI
$UI.BackgroundColor = "Black"
$UI.ForegroundColor = "White"
$Error.Clear()

Do
{
  Do
  {
    Clear-Host
    Write-Host -ForegroundColor White -BackgroundColor DarkGreen "Phase - 1"
    Write-Host `n"------------------------------------"
    Write-Host "-- Hyper-V Initial Configurations --"
    Write-Host "------------------------------------"
    Write-Host `n"1) Essential Settings for Hyper-V"
    Write-Host `n"2) Windows Features for Hyper-V and Failover Clustering"
    Write-Host `n"3) Physical and Virtual Network Configurations"
    Write-Host `n"4) Network Interface Jumbo Frame Settings"
    Write-Host -NoNewline `n`n"Select Task "
    Write-Host -foregroundColor Yellow -NoNewline "[ID]"
    Write-Host -NoNewline " or "
    Write-Host -foregroundColor Yellow -NoNewline "[Q]"
    Write-Host -NoNewline "uit: "
    $FunctionID = Read-Host
  }
  While ((!$FunctionID -or $FunctionID -eq 0 -or $FunctionID -gt 4) -and $FunctionID -ne "Q")

  Switch ($FunctionID)
  {
  "1" {Essential}
  "2" {WindowsFeatures}
  "3" {VirtualNetworks}
  "4" {JumboFrame}
  "Q" {
        Write-Host `n`n"Script Ended."`n`n
        Exit 0
      }
  }
}
While ($True)

 
:
Posted by 커널64
2013. 8. 22. 14:00

Hyper-V 환경에서의 DPM 백업 관련 SystemCenter2013. 8. 22. 14:00

Hyper-V 기반의 서버 가상화 환경에서 일반적으로 DPM을 이용해 VM에 대한 백업을 수행합니다.
그런데, Windows Server 2012가 되면서 호스트 간 실시간 마이그레이션 뿐만 아니라 스토리지에 대한 라이브 마이그레이션 기능까지 지원하게 되면서 DPM 입장에서 VM의 호스트가 변경되거나 스토리지 위치가 변경되는 경우 백업이 실패하는 경우가 발생할 수 있습니다.
이러한 문제를 해결하기 위해 DPM 2012 SP1에서는 VMM과의 상호 작용을 통해 백업이 실패하지 않도록 하는 기능이 추가되었습니다.


DPM과 VMM의 연동(?) 구성 절차는 다음과 같습니다.

1. 대상 Hyper-V 호스트에 DPM 및 VMM 에이전트를 설치합니다.

2. DPM 서버에 VMM 콘솔을 설치합니다.

3. DPM 관리 셸(DPM Management Shell)을 실행한 후 다음 명령을 입력합니다.
Set-DPMGlobalProperty -DPMServerName <DPM 서버 이름> -KnownVMMServers <VMM 서버 이름>
* 참고: VMM 서버는 하나만 등록할 수 있습니다.

4. 입력이 정상적으로 되었는지 Get-DPMGlobalProperty -PropertyName KnownVMMServers 명령으로 확인합니다.
 

5. 서비스 콘솔에서 DPM-VMM 도우미 서비스(DPMVMMHelperService)가 시작되어 있는지 확인합니다.
* 참고: 해당 서비스는 시스템 계정으로 실행되므로, VMM에 적절한 권한을 부여합니다.
 


 
:
Posted by 커널64
System Center 솔루션 중 연동, 자동화 솔루션인 Orchestrator를 통해 PowerShell 스크립트를 실행하는 경우 ExecutionPolicy의 기본 보안 설정에 따라 아래와 같이 경고, 오류가 발생합니다.


이런 경우 Set-ExecutionPolicy Cmdlet을 실행해 실행 정책을 Remotesigned 또는 Unrestrited로 설정해 주어야 합니다.



그런데, 이렇게 설정해 주었음에도 불구하고 계속해서 위 오류가 발생하는 경우를 겪으시는 분들이 있으실 겁니다.
이는 기본적으로 PowerShell을 실행하면 64비트 PowerShell이 실행되는데 Orchestrator는 32비트 PowerShell을 실행하기 때문에 발생합니다. 프로그램 목록을 검색해 32비트 PowerShell을 실행해 동일하게 ExecutionPolicy를 설정하면 됩니다.

 


 
:
Posted by 커널64
System Center 2012 SP1 기준의 몇 가지 참고 사항들입니다. 배포 시 참고하시기 바랍니다.

System Requirements for System Center 2012 SP1


SQL Server 지원 버전
- SQL Server 2008 R2 SP1 Standard 및 Datacenter
- SQL Server 2008 R2 SP2 Standard 및 Datacenter
- SQL Server 2012 Standard 및 Enterprise
- SQL Server 2012 SP1 Standard 및 Enterprise


SQL Server 2012의 AlwaysOn 구성 지원
- App Controller 
- Operations Manager 
- Orchestrator 
- Service Manager 
- Virtual Machine Manager

* DPM과 CM은 AlwaysOn을 지원하지 않음


아래 서버들은 동일한 서버에 함께 설치될 수 없음
- SCDPM 관리 서버
- SCOM 관리 서버
- SCSM 관리 서버
- SCSM DW 관리 서버


VMM 관리 서버를 제외한 나머지 서버 역할들은 Windows Server 2008 R2 SP1 이상의 운영 체제에 설치가 가능하며, VMM 관리 서버는 Windows Server 2012에만 설치가 가능함


Windows 7, Windows 8, Windows Server 2008 R2 SP1, Windows Server 2012에 설치될 수 있는 콘솔
- App Controller PowerShell 모듈
- DPM Central Console
- DPM Remote Administrator
- Operations Manager Operations Console
- Orchestrator Runbook Designer
- Service Manager Console
- Virtual Manager Manager Console


DPM 에이전트 지원 운영 체제 및 서버 제품
- Windows Server 2003 SP2
(KB932370, KB940349, KB975759 설치 필요)

- Windows Server 2008, SP2
(KB975759, KB977381 설치 필요)

- Windows Server R2, R2 SP1
(KB977381 설치 필요)

- Windows Server 2012
- Windows XP Pro SP3(x86), SP2(x64)
- Windows Vista SP2
- Windows 7
- Windows 8

- SQL Server 2000
- SQL Server 2005
- SQL Server 2008 SP1, SP2, SP3, R2, R2 SP1
- SQL Server 2012

- Exchange Server 2003, 2007, 2010

- WSS 3.0
- SharePoint 2007, 2010


:
Posted by 커널64