달력

1

« 2025/1 »

  • 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

스크립트로 만들어야겠다.. 너무 많다...;;;

-Show IP Configration-
netsh interface ipv4 show config

-Config IP Address-
netsh interface ipv4 set address name="로컬 영역 연결" static <IP> <Subnet Mask> <G/W>

-Add DNS Server IP Address-
netsh interface ipv4 add dnsserver "로컬 영역 연결" <DNS Server IP>

-Join Domain-
netdom join <HostName> /Domain:<DomainName> /UserD:<DomainUser> /PasswordD:*

-Rename Computer-
netdom renamecomputer <HostName> /NewName:<NewHostName> /UserD:<DomainUser> /PasswordD:*

-Enable RDP(Disable Secure Level)-
Cscript c:\windows\system32\scregedit.wsf /ar 0
Cscript c:\windows\system32\scregedit.wsf /cs 0

-Configure Firewall-
Netsh advfirewall firewall set rule group="원격 관리" new enable=yes
Netsh advfirewall firewall set rule group="WMI(Windows Management Instrumentation)" new enable=yes
Netsh advfirewall firewall set rule group="파일 및 프린터 공유" new enable=yes
Netsh advfirewall firewall set rule group="원격 볼륨 관리" new enable=yes
Netsh advfirewall firewall set rule group="원격 이벤트 로그 관리" new enable=yes
Netsh advfirewall firewall set rule group="원격 서비스 관리" new enable=yes
Netsh advfirewall firewall set rule group="Windows 방화벽 원격 관리" new enable=yes
Netsh advfirewall firewall set rule group="핵심 네트워킹" new enable=yes
Netsh advfirewall firewall set rule group="원격 데스크톱" new enable=yes

-Allow Remote Device Management-
mmc > 그룹 정책 개체 편집기 > Server Core >
컴퓨터 구성 > 관리 템플릿 > 시스템 > 장치 설치 > PnP 인터페이스에 대한 원격 액세스 허용

-Install Features-
start /w ocsetup FailoverCluster-Core
start /w ocsetup MultipathIo
start /w ocsetup TelnetClient

-Install Hyper-V Role-
Start /w ocsetup Microsoft-Hyper-V

-Windows Activation-
Slmgr.vbs -ipk <Product Key> <- Input Product Key
Slmgr.vbs -ato <- Activation
Slmgr.vbs -dlv <- Show Activation Status

:
Posted by 커널64
2009. 4. 21. 15:03

P2V 시 BITS 포트 변경(기본값: 443) Virtualization2009. 4. 21. 15:03

SCVMM의 P2V 시 BITS 포트 변경

1. HKLM\Software\Microsoft\Microsoft System Center Virtual Machine Manager Server\Settings
2. DWORD 값 생성, P2VBITSTcpPort
3. 해당 DWORD의 값을 원하는 포트로 설정
4. Virtual Machine Manager 서비스 재시작

:
Posted by 커널64

SCCM 하드웨어 인벤토리 커스터마이징

- 레지스트리 정보 수집 및 보고(Resource Explorer)

 

Primary site server <ConfigMgr Install Directory>\inboxes\clifiles.src\hinv 폴더의 두 개의 MOF 파일(Configuration.mof, SMS_def.mof)을 기반으로 하드웨어 정보가 수집된다.

 

Configuration.mof

이 파일은 하드웨어 인벤토리 클라이언트 에이전트에 의해 수집되는 데이터 클래스를 정의하는데 사용된다.

데이터 클래스는 시스템에 존재하는 WMI 데이터나 레지스트리 키를 기반으로 생성될 수 있다.

 

SMS_def.mof

이 파일은 하드웨어 인벤토리 에이전트에 의해 수집된 데이터 정보를 보고에 보여줄지 말지를 정의한다.

보고 클래스는 WMI 데이터 클래스를 기반으로 하며 기본적으로 제공되는 클래스나 Configuration.mof에서 사용자 정의를 통해 추가된 클래스가 될 수 있다.

SMS_def.mof 파일에 설정된 클래스 보고 정보는 클라이언트의 컴퓨터 정책 실행 간격 중에 보고 정책으로 변환된다. 클라이언트는 새로운 보고 정책을 컴파일 한 후 보고 정책 정보는 클라이언트의 WMI 저장소의 Root\CCM\Policy\Machine 네임스페이스, InventoryDataItem 클래스에 저장된다.

 

 

HKLM\SOFTWARE\Custom Value 키 하위로 다음과 같은 키가 있는 상황을 예로 들면

사용자 삽입 이미지

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 




 


1. 먼 Configuration.mof 파일에 다음과 같은 내용을 추가한다.

 

#pragma namespace("\\\\.\\root\\cimv2")

#pragma deleteclass("Win32Reg_CustomValue",NOFAIL)

 

[ dynamic,

provider("RegProv"),

ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Custom Value")

]

 

class Win32Reg_CustomValue

{

[Key] string ApplicationName;

[PropertyContext("ProductName")] string ProductName;

[PropertyContext("ProductFile")] string ProductFile;

[PropertyContext("ProductVer")] string ProductVer;

};

 

위 내용을 요약하면

- cimv2 네임스페이스에 있는 Win32Reg_CustomValue 클래스 제거

- HKEY_LOCAL_MACHINE\\SOFTWARE\\Custom Value에 대한 레지스트리 검색 프로바이더 정의

- Win32Reg_CustomValue 클래스 생성 및 값 설정


 

2. 다음으로 SMS_def.mof 파일에 다음과 같은 내용을 추가한다.

 

#pragma namespace ("\\\\.\\root\\cimv2\\sms")

#pragma deleteclass("Win32Reg_CustomValue",NOFAIL)

 

[ SMS_Report (TRUE),

SMS_Group_Name ("Custom Inventory")

SMS_Class_ID ("KWANGSEOK|CustomInventory|1.0") ]

 

class Win32Reg_CustomValue : SMS_Class_Template

{

[SMS_Report (TRUE), Key ] string ApplicationName;

[SMS_Report (TRUE)] string ProductName;

[SMS_Report (TRUE)] string ProductFile;

[SMS_Report (TRUE)] string ProductVer;

};

 

위 내용을 요약하면

- cimv2\sms 네임스페이스에 있는 Win32Reg_CustomValue 클래스 제거

- 보고 여부 설정 및 그룹 이름, 클래스 ID 설정

- Win32Reg_CustomValue 클래스 생성 및 값 입력


 

3. 위 과정이 완료된 후 컴퓨터 정책/하드웨어 인벤토리 실행이 끝나면

Resource Explorer > Hardware 하위에서 확인이 가능하다.

:
Posted by 커널64

Object Restore for ActiveDirectory 1.0
:
Posted by 커널64

App-V의 모델
1. Standalone Model
시퀀싱 작업의 한 부분으로 .msi 패키지를 생성해 배포한다.(GPO, SCCM)
.msi 패키지 파일에는 배포 정보, 바로가기, 설치 루틴이 포함된다.

사용 환경
- App-V 환경에 접속할 수 없는 원격지 사용자가 있는 경우
- SMS 2003, SCCM 2007등 소프트웨어 관리 솔루션이 이미 있는 경우
- 소프트웨어를 배포하기 위한 대역폭이 충분하지 않은 경우


2. Streaming Model
응용 프로그램은 Feature Block을 통해 전송(Streaming)된다.
프로그램이 실행되는 데에는 Feature Block 1(FB1)만 필요하다.
이는 응용 프로그램의 빠른 실행을 가능하게 한다.

사용 환경
- 응용 프로그램의 배포에 SCCM 2007 SP1 with R2을 사용하는 경우
- Active Directory가 구성되어 있지 않은 상황에서 스트리밍을 이용해 배포하려 하는 경우

스트리밍 서버 역할 종류
- App-V Management Server or Streaming Server(Active upgrade) - RTSP/RTSPS
- File Server(No Active upgrade) - SMB
- IIS Server(No Active upgrade) - HTTP/HTTPS


3. Full Infrastructure Model
하나 이상의 App-V 관리 서버로 구성되며 SQL Server 데이터베이스가 필요하다.
App-V의 관리를 위해 관리 콘솔이 필요하다.(관리 서버에 설치하거나 별도의 워크스테이션에 설치한다.)

사용 환경
- 관리 서버를 이용해 응용 프로그램의 바로가기를 클라이언트에 배포하고자 하는 경우
- 관리서버의 추가적인 보고서 기능을 필요로 하는 경우
- 그룹 기반의 응용 프로그램 배포가 필요한 경우
- 라이선스 관리가 필요한 경우
- 응용 프로그램을 클라이언트로 신속하게 배포하고자 하는 경우

구성 역할
- App-V Management Server
- Streaming Server
- Server running App-V Management Web Service
- SQL Server
- Active Directory
- App-V Management Console
- Sequencer for creating virtualized application packages
- App-V Client installed on systems requiring app virtualization (desktops, VMs, or Terminal Servers)


고가용성 구성
- SQL Server (MSCS) - SQL Server 2000(SP3a/SP4), SQL Server 2005(SP1/SP2), SQL Server 2008
- Streaming Server(Network Load-Balancing)
- Management Server(Network Load-Balancing)
- Management Server Service(N/A)

 

:
Posted by 커널64
2009. 4. 7. 08:39

Volume GUID 확인 VB Script Etc.2009. 4. 7. 08:39

GetVolumeGUID.vbs


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_Volume")

For Each objItem In colItems
    WScript.Echo "Automount: " & objItem.Automount
    WScript.Echo "Block Size: " & objItem.BlockSize
    WScript.Echo "Capacity: " & objItem.Capacity
    WScript.Echo "Caption: " & objItem.Caption
    WScript.Echo "Compressed: " & objItem.Compressed
    WScript.Echo "Device ID: " & objItem.DeviceID
    WScript.Echo "Dirty Bit Set: " & objItem.DirtyBitSet
    WScript.Echo "Drive Letter: " & objItem.DriveLetter
    WScript.Echo "Drive Type: " & objItem.DriveType
    WScript.Echo "File System: " & objItem.FileSystem
    WScript.Echo "Free Space: " & objItem.FreeSpace
    WScript.Echo "Indexing Enabled: " & objItem.IndexingEnabled
    WScript.Echo "Label: " & objItem.Label
    WScript.Echo "Maximum File Name Length: " & objItem.MaximumFileNameLength
    WScript.Echo "Name: " & objItem.Name
    WScript.Echo "Quotas Enabled: " & objItem.QuotasEnabled
    WScript.Echo "Quotas Incomplete: " & objItem.QuotasIncomplete
    WScript.Echo "Quotas Rebuilding: " & objItem.QuotasRebuilding
    WScript.Echo "Serial Number: " & objItem.SerialNumber
    WScript.Echo "Supports Disk Quotas: " & objItem.SupportsDiskQuotas
    WScript.Echo "Supports File-Based Compression: " & _
        objItem.SupportsFileBasedCompression
    WScript.Echo
Next

:
Posted by 커널64

정의

- 클러스터 이름: VCLUSTER

- 클러스터 노드: SQLNode1, SQLNode2

- 가상 SQL 서버 이름: SQLCLUSTERA

- 도메인 이름: VDOMAIN

 

SQLNode1의 하드웨어에 문제가 생겨 재설치가 필요한 상황을 가정

1.     클러스터 관리 도구에서 SQLNode1을 제거(Evict)

2.     SQLNode1의 운영체제 재설치 후 네트워크 설정(Public, Private)

-       DNS 서버에서 IP 정보가 반영되었는지 확인

3.     서버의 이름을 SQLNode1으로 변경 후 도메인 가입

4.     SQLNode2의 전원을 종료하고 SQLNode1을 재시작한다. SQLNode2의 전원을 종료해야 하는 이유는 공유 SCSI 디스크의 소유권을 SQLNode1이 가지게끔 하기 위해서이다.

-       소유권을 가져오면 쿼럼 디스크와 공유 디스크의 드라이브 문자를 설정한다.

5.     SQLNode2에 보이는 것과 동일하게 SQLNode1의 그룹에 필요한 로그인 정보를 추가한다.

6.     SQLNode2의 전원을 켠 후 SQLNode2를 클러스터에 가입시킨다.

7.     테스트를 위해 ‘Cluster Group’의 장애 조치를 해 본다.

-       ‘Cluster Group’에 마우스 우클릭 후 ‘Move Group’을 통해 양 노드로 테스트한다.

8.     SQLNode1 SQL Cluster ‘SQLCLUSTERA’에 추가한다.

-       SQLNode2 SQL Server 2000 Enterprise 설치 미디어를 넣고 실행한다.

-       Computer Name 페이지에서 Virtual Server를 선택하고 SQLCLUSTERA를 입력한다.

-       Advanced Options를 선택한다.

-       Maintain a Virtual Server for Failover Clustering을 선택한다.

-       Failover Clustering 페이지에서 다음을 클릭한다. (IP 정보 변경이 없는 경우)

-       Cluster Management 페이지에서 SQLNODE1을 선택하고 추가한다.

-       Remote Information 페이지에서 Cluster 계정 정보를 입력하고 다음을 클릭한다.

-       진행 화면이 나타난 후 완료 메시지를 확인하고 완료를 클릭한다.

9.     필요한 서비스팩을 다운 받아 설치한다.

10.   SQL Cluster Group Failover를 테스트해 본다.

:
Posted by 커널64

-       The requested operation cannot be performed on a file with a user-mapped section open. (0x800704C8)

-       'VMName' Microsoft Synthetic Ethernet Port (Instance ID {7E0DA81A-A7B4-4DFD-869F-37002C36D816}): Failed to Power On with Error 'The specified network resource or device is no longer available.' (0x80070037)

-       The I/O operation has been aborted because of either a thread exit or an application request. (0x800703E3)

-       Virtual machines disappear from the Hyper-V Management Console

부모 파티션에 백신 프로그램이 설치되어 있는 경우 위와 같은 증상이 발생할 수 있다.

 

해결 방법

백신 설정에서 다음 사항에 대해 예외 설정

-       Default virtual machine configuration directory (C:\ProgramData\Microsoft\Windows\Hyper-V)

-       Custom virtual machine configuration directories

-       Default virtual hard disk directory (C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks)

-       Custom virtual hard disk directories

-       Snapshot directories

-       Vmms.exe

-       Vmwp.exe

:
Posted by 커널64

– Find all managed servers that are down and not pingable
SELECT bme.DisplayName, s.LastModified
FROM state AS s, BaseManagedEntity AS
bme
WHERE s.basemanagedentityid = bme.basemanagedentityid AND
s.monitorid
IN (SELECT MonitorId FROM Monitor WHERE MonitorName = ‘Microsoft.SystemCenter.HealthService.ComputerDown’)

AND s.Healthstate = ‘3′
ORDER BY s.Lastmodified DESC

– Operational Database Version
SELECT DBVersion FROM __MOMManagementGroupInfo__

– Find a computer name from it’s Health Service ID (guid from agent proxy alerts)
SELECT id, path, fullname, displayname FROM ManagedEntityGenericView WHERE ID = ‘<GUID>’


– ALERTS SECTION –
——————–

– Most common alerts, by alert count
SELECT AlertStringName, AlertStringDescription, AlertParams, Name, SUM(1) AS AlertCount, SUM(RepeatCount+1) AS AlertCountWithRepeatCount
FROM Alertview WITH (NOLOCK)

WHERE ResolutionState = (0|255)
GROUP BY AlertStringName, AlertStringDescription, AlertParams, Name
ORDER BY AlertCount DESC

– TOP 10 common alerts
SELECT Top(10) AlertStringName, AlertStringDescription, AlertParams, Name, SUM(1) AS AlertCount, SUM(RepeatCount+1) AS AlertCountWithRepeatCount
FROM Alertview WITH (NOLOCK)

WHERE ResolutionState = (0|255)
GROUP BY AlertStringName, AlertStringDescription, AlertParams, Name
ORDER BY AlertCount DESC

– Most common alerts, by repeat count
SELECT AlertStringName, AlertStringDescription, AlertParams, Name, SUM(1) AS AlertCount, SUM(RepeatCount+1) AS AlertCountWithRepeatCount
FROM Alertview WITH (NOLOCK)

WHERE ResolutionState = (0|255)
GROUP BY AlertStringName, AlertStringDescription, AlertParams, Name
ORDER BY AlertCountWithRepeatCount DESC

– Number of alerts per day
SELECT CONVERT(VARCHAR(20), TimeAdded, 101) AS DayAdded, COUNT(*) AS NumAlertsPerDay
FROM Alert WITH (NOLOCK)

GROUP BY CONVERT(VARCHAR(20), TimeAdded, 101)
ORDER BY DayAdded DESC

– Number of alerts per day by resolution state
SELECT
CASE WHEN
(GROUPING(CONVERT(VARCHAR(20), TimeAdded, 101)) = 1) THEN ‘All Days’ ELSE CONVERT(VARCHAR(20), TimeAdded, 101) END AS [Date],
CASE WHEN
(GROUPING(ResolutionState) = 1) THEN ‘All Resolution States’ ELSE CAST(ResolutionState AS VARCHAR(5)) END AS [ResolutionState]
,
COUNT
(*) AS
NumAlerts
FROM Alert WITH (NOLOCK)

GROUP BY CONVERT(VARCHAR(20), TimeAdded, 101), ResolutionState WITH ROLLUP
ORDER BY DATE DESC


– EVENTS SECTION –
——————–

– Most common events by day by count
SELECT CASE WHEN(GROUPING(CONVERT(VARCHAR(20), TimeAdded, 101)) = 1)
THEN
‘All Days’
ELSE CONVERT
(VARCHAR(20), TimeAdded, 101) END AS DayAdded,
COUNT
(*) AS
NumEventsPerDay
FROM
EventAllView
GROUP BY CONVERT(VARCHAR(20), TimeAdded, 101) WITH
ROLLUP
ORDER BY DayAdded DESC

– Most common events by event number
SELECT Number, COUNT(*) AS "Number of Events"
FROM EventView
GROUP BY
Number
ORDER BY "Number of Events" DESC


– PERFORMANCE SECTION –
————————-

– Performance Insertions per day
SELECT CASE WHEN(GROUPING(CONVERT(VARCHAR(20), TimeSampled, 101)) = 1)
THEN
‘All Days’ ELSE CONVERT(VARCHAR(20), TimeSampled, 101)
END
AS DaySampled, COUNT(*) AS NumPerfPerDay
FROM
PerformanceDataAllView
GROUP BY CONVERT(VARCHAR(20), TimeSampled, 101) WITH
ROLLUP
ORDER BY DaySampled DESC

– Most common performance insertions by perf object and counter name:
SELECT pcv.objectname, pcv.countername, count (pcv.countername) AS total FROM performancedataallview AS pdv, performancecounterview AS pcv
WHERE (pdv.performancesourceinternalid = pcv.performancesourceinternalid)

GROUP BY pcv.objectname, pcv.countername
ORDER BY count (pcv.countername) DESC

– Most common performance insertions by perf object name:
SELECT pcv.objectname, count (pcv.countername) AS total FROM performancedataallview AS pdv, performancecounterview AS pcv
WHERE (pdv.performancesourceinternalid = pcv.performancesourceinternalid)

GROUP BY pcv.objectname
ORDER BY count (pcv.countername) DESC

– Most common performance insertions by perf counter name:
SELECT pcv.countername, count (pcv.countername) AS total FROM performancedataallview AS pdv, performancecounterview AS pcv
WHERE (pdv.performancesourceinternalid = pcv.performancesourceinternalid)

GROUP BY pcv.countername
ORDER BY count (pcv.countername) DESC


– STATE SECTION –
——————-

– State changes per day:
SELECT CASE WHEN(GROUPING(CONVERT(VARCHAR(20), TimeGenerated, 101)) = 1)
THEN
‘All Days’ ELSE CONVERT(VARCHAR(20), TimeGenerated, 101)
END
AS DayGenerated, COUNT(*) AS NumEventsPerDay
FROM StateChangeEvent WITH (NOLOCK)

GROUP BY CONVERT(VARCHAR(20), TimeGenerated, 101) WITH ROLLUP
ORDER BY DayGenerated DESC


– MANAGEMENT PACK INFO –
————————–

– To find all installed Management Packs and their version:
SELECT MPName, MPFriendlyName, MPVersion, MPIsSealed
FROM ManagementPack WITH(NOLOCK)

ORDER BY MPName

– Rules per MP:
SELECT mp.MPName, COUNT(*) AS RulesPerMP
FROM
Rules r
INNER JOIN ManagementPack mp ON
mp.ManagementPackID = r.ManagementPackID
GROUP BY
mp.MPName
ORDER BY RulesPerMP DESC

– Rules per MP by category:
SELECT mp.MPName, r.RuleCategory, COUNT(*) AS RulesPerMPPerCategory
FROM
Rules r
INNER JOIN ManagementPack mp ON
mp.ManagementPackID = r.ManagementPackID
GROUP BY
mp.MPName, r.RuleCategory
ORDER BY RulesPerMPPerCategory DESC

– Monitors Per MP:
SELECT mp.MPName, COUNT(*) AS MonitorsPerMPPerCategory
FROM
Monitor m
INNER JOIN ManagementPack mp ON
mp.ManagementPackID = m.ManagementPackID
GROUP BY
mp.MPName
ORDER BY COUNT(*) DESC

– To find your Monitor by common name:
SELECT * FROM Monitor
INNER JOIN LocalizedText LT ON
LT.ElementName = Monitor.MonitorName
WHERE LTValue = ‘My Monitor Name’

– To find all Rules per MP that generate an alert:
declare @mpid
AS varchar(50)
SELECT @mpid= managementpackid FROM managementpack WHERE
mpName=
‘Microsoft.BizTalk.Server.2006.Monitoring’
SELECT rl.rulename,rl.ruleid,md.modulename FROM rules rl, module md
WHERE
md.managementpackid = @mpid
AND
rl.ruleid=md.parentid
AND moduleconfiguration LIKE ‘%<AlertLevel>50</AlertLevel>%’

– To find all rules per MP with a given alert severity:
declare @mpid
AS varchar(50)
SELECT @mpid= managementpackid FROM managementpack WHERE
mpName=
‘Microsoft.BizTalk.Server.2006.Monitoring’
SELECT rl.rulename,rl.ruleid,md.modulename FROM rules rl, module md
WHERE
md.managementpackid = @mpid
AND
rl.ruleid=md.parentid
AND moduleconfiguration LIKE ‘%<Severity>2</Severity>%’

– Number of instances of a type:  (Number of disks, computers, databases, etc that OpsMgr has discovered)
SELECT mt.ManagedTypeID, mt.TypeName, COUNT(*) AS NumEntitiesByType
FROM BaseManagedEntity bme WITH(NOLOCK)

LEFT JOIN ManagedType mt WITH(NOLOCK) ON mt.ManagedTypeID = bme.BaseManagedTypeID
WHERE bme.IsDeleted = 0

GROUP BY mt.ManagedTypeID, mt.TypeName
ORDER BY COUNT(*) DESC

– Number of Views per Management Pack:
SELECT mp.MPName, v.ViewVisible, COUNT(*) AS ViewsPerMP
FROM [Views]
v
INNER JOIN ManagementPack mp ON
mp.ManagementPackID = v.ManagementPackID
GROUP BY
 mp.MPName, v.ViewVisible
ORDER BY v.ViewVisible DESC, COUNT(*) DESC

– Grooming:
SELECT * FROM PartitionAndGroomingSettings WITH (NOLOCK)

– All managed computers count:
SELECT COUNT(*) AS NumManagedComps FROM (
SELECT bme2.BaseManagedEntityID
FROM BaseManagedEntity bme WITH (NOLOCK)

INNER JOIN BaseManagedEntity bme2 WITH (NOLOCK) ON bme2.BaseManagedEntityID = bme.TopLevelHostEntityID
WHERE bme2.IsDeleted = 0

AND bme2.IsDeleted = 0
AND bme2.BaseManagedTypeID = (SELECT TOP 1 ManagedTypeID FROM ManagedType WHERE TypeName = ‘microsoft.windows.computer’)
GROUP BY bme2.BaseManagedEntityID
) AS Comps

– Classes available in the DB:
SELECT * FROM ManagedType

– Classes available in the DB for Microsoft Windows type:
SELECT * FROM ManagedType
WHERE TypeName LIKE ‘Microsoft.Windows.%’

– Every property of every class:
SELECT * FROM MT_Computer

– All instances of all types once discovered
SELECT * FROM BaseManagedEntity

– To get the state of every instance of a particular monitor the following query can be run, (replace <MonitorName> with the name of the monitor):
SELECT bme.FullName, bme.DisplayName, s.HealthState FROM state AS s, BaseManagedEntity AS bme
WHERE
s.basemanagedentityid = bme.basemanagedentityid
AND s.monitorid IN (SELECT MonitorId FROM Monitor WHERE MonitorName = ‘<MonitorName>’)

– For example, this gets the state of the Microsoft.SQLServer.2005.DBEngine.ServiceMonitor for each instance of the SQL 2005 Database Engine class.
SELECT bme.FullName, bme.DisplayName, s.HealthState
FROM state AS s, BaseManagedEntity AS
bme
WHERE
s.basemanagedentityid = bme.basemanagedentityid
AND s.monitorid IN (SELECT MonitorId FROM Monitor WHERE MonitorName = ‘Microsoft.SQLServer.2005.DBEngine.ServiceMonitor’)

– To find the overall state of any object in OpsMgr the following query should be used to return the state of the System.EntityState monitor:
SELECT bme.FullName, bme.DisplayName, s.HealthState
FROM state AS s, mt_managedcomputer AS mt, BaseManagedEntity AS
bme
WHERE
s.basemanagedentityid = bme.basemanagedentityid
AND s.monitorid IN (SELECT MonitorId FROM Monitor WHERE MonitorName = ‘System.Health.EntityState’)

– Rules are stored in a table named Rules. This table has columns linking rules to classes and Management Packs.
– To find all rules in a Management Pack use the following query and substitute in the required Management Pack name:
SELECT * FROM Rules WHERE ManagementPackID = (SELECT ManagementPackID FROM ManagementPack WHERE MPName = ‘Microsoft.Windows.Server.2003′)

– To find all rules targeted at a given class use the following query and substitute in the required class name:
SELECT * FROM Rules WHERE TargetManagedEntityType = (SELECT ManagedTypeId FROM ManagedType WHERE TypeName = ‘Microsoft.Windows.Computer’)

– The Alert table contains all alerts currently open in OpsMgr. This includes resolved alerts until they are groomed out of the database. To get all alerts across all instances of a given monitor use the following query and substitute in the required monitor name:

SELECT * FROM Alert WHERE ProblemID IN (SELECT MonitorId FROM Monitor WHERE MonitorName = ‘Microsoft.SQLServer.2005.DBEngine.ServiceMonitor’)

– To retrieve all alerts for all instances of a specific class use the following query and substitute in the required table name, in this example MT_DBEngine is used to look for SQL alerts:
SELECT * FROM Alert WHERE BaseManagedEntityID IN (SELECT BaseManagedEntityID FROM MT_DBEngine)

– To determine which table is currently being written to for event and performance data use the following query:
SELECT * FROM PartitionTables WHERE IsCurrent = 1

– To retrieve events generated by a specific rule use the following query and substitute in the required rule ID:
SELECT * FROM Event_00 WHERE RuleId = (SELECT RuleId FROM Rules WHERE RuleName = ‘Microsoft.Windows.Server.2003.OperatingSystem.CleanShutdown.Collection ‘)

– To retrieve all events generated by rules in a specific Management Pack the following query can be used where the Management Pack name is substituted with the required value:
SELECT * FROM EventAllView
WHERE RuleID IN (SELECT RuleId FROM Rules WHERE
ManagementPackId =
(SELECT ManagementPackId FROM ManagementPack WHERE MPName = ‘Microsoft.Windows.Server.2003′))

– To retrieve all performance data for a given rule in a readable format use the following query:
SELECT pc.ObjectName, pc.CounterName, ps.PerfmonInstanceName, pd.SampleValue, pd.TimeSampled
FROM PerformanceDataAllView AS pd, PerformanceCounter AS pc, PerformanceSource AS
ps
WHERE pd.PerformanceSourceInternalId IN (SELECT PerformanceSourceInternalId FROM
PerformanceSource
WHERE RuleId = (SELECT RuleId FROM Rules WHERE RuleName =‘ Microsoft.Windows.Server.2003.LogicalDisk.FreeSpace.Collection’))

– Information on existing User Roles:
SELECT UserRoleName, IsSystem FROM userrole

– Grooming in the DataWarehouse:
– Grooming no longer uses SQL agent jobs.  Grooming is handled by scheduled stored procedures, that run much more frequently, which provides less impact than in the previous version.
– Default grooming for the DW for each dataset, to examine Data Warehouse grooming settings:
SELECT AggregationIntervalDurationMinutes, BuildAggregationStoredProcedureName, GroomStoredProcedureName, MaxDataAgeDays, GroomingIntervalMinutes FROM StandardDatasetAggregation

– The first row is the interval in minutes.
– NULL is raw data, 60 is hourly, and 1440 is daily.
– The second and third row shows what data it is
– MaxDataAgeDays has the retention period in days - this is the field to update if the administrator wants to lower the days of retention.
– RAW alert – 400 days
– RAW event – 100 days
– RAW perf – 10 days (hourly and daily perf = 400 days)
– RAW state – 180 days  (hourly and daily state = 400 days)

– AEM Queries (Data Warehouse):

– Default query to return all RAW AEM data:
SELECT * FROM [CM].[vCMAemRaw] Rw
INNER JOIN dbo.AemComputer Computer ON
Computer.AemComputerRowID = Rw.AemComputerRowID
INNER JOIN dbo.AemUser Usr ON
Usr.AemUserRowId = Rw.AemUserRowId
INNER JOIN dbo.AemErrorGroup EGrp ON
Egrp.ErrorGroupRowId = Rw.ErrorGroupRowId
INNER JOIN dbo.AemApplication App ON App.ApplicationRowId = Egrp.ApplicationRowId

– Count the raw crashes per day:
SELECT CONVERT(char(10), DateTime, 101) AS "Crash Date (by Day)", COUNT(*) AS "Number of Crashes"
FROM [CM].[vCMAemRaw]
GROUP BY CONVERT(char(10), DateTime, 101)
ORDER BY "Crash Date (by Day)" DESC

– Count the total number of raw crashes in the DW database:
SELECT count(*) FROM CM.vCMAemRaw

– Default grooming for the DW for the AEM dataset:  (Aggregated data kept for 400 days, RAW 30 days by default)
SELECT AggregationTypeID, BuildAggregationStoredProcedureName, GroomStoredProcedureName, MaxDataAgeDays, GroomingIntervalMinutes
FROM StandardDatasetAggregation WHERE BuildAggregationStoredProcedureName = ‘AemAggregate’


– MISCELLANEOUS SECTION –
—————————

– Simple query to display large tables, to determine what is taking up space in the database:
SELECT so.name,
8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) AS
data_kb,
Coalesce
(8 * Sum(CASE WHEN si.indid NOT IN (0, 1, 255) THEN si.reserved END), 0) AS
index_kb,
Coalesce
(8 * Sum(CASE WHEN si.indid IN (255) THEN si.reserved END), 0) AS
blob_kb
FROM dbo.sysobjects AS so JOIN dbo.sysindexes AS si ON (si.id = so.id)

WHERE ‘U’ = so.type GROUP BY so.name  ORDER BY data_kb DESC

– Is SQL broker enabled?
SELECT is_broker_enabled FROM sys.DATABASES WHERE name = ‘OperationsManager’

– How to identify your version of SQL server:
SELECT  SERVERPROPERTY(‘productversion’), SERVERPROPERTY (‘productlevel’), SERVERPROPERTY (‘edition’)

– SQL 2005:
– SQL Server 2005 RTM                    2005.90.1399
– SQL Server 2005 SP1                     2005.90.2047
– SQL Server 2005 SP1 plus 918222  2005.90.2153
– SQL Server 2005 SP2                     2005.90.3042

 

:
Posted by 커널64
SCCM System Center Configuration Manager 2007 Push Install
Client Push Installation을 하기 위한 클라이언트의 요구 사항 (방화벽 사용 시)
다음 예외 적용 GPO Group Policy 그룹 정책
- File and Printer Sharing
- Windows Management Instrumentation (WMI)

Windows 2003



Windows 2008


그룹 정책에서 정책 수정 시에는위와 같이 컴퓨터 구성 > 관리 템플릿 > 네트워크 > 네트워크 연결 > Windows 방화벽 > 도메인 프로필 > 원격 관리 허용, 파일 및 프린터 공유 허용
:
Posted by 커널64