匯出 Active Directory全部 User 資訊為 csv檔

dsquery * OU=xxx,DC=domain,DC=local -filter “(&(objectClass=person)(objectClass=user)(cn=*)(!userAccountControl:1.2.840.113556.1.4.803:=2))” -attr cn mail title  -uco -limit 0  > C:\domain_user.csv
藍色部分代表只要匯出 Enable 的User
綠色部份依要匯出的AD位置輸入 , 如果是整個 Domain 的內容 , 那就不需要最前頭的 OU=xxx,
紅色部份是要匯出的User 資訊 , 欄位名稱資訊如下
https://technet.microsoft.com/zh-tw/library/gg232586.aspx

附錄 B – 對應 Active Directory 網域服務屬性與 Service Manager 內容

更新日期: 2010年12月
適用於: System Center Service Manager 2010 SP1
System Center Service Manager 2010 可使用 Active Directory 連接器,同步處理 User、Group、Computer 和 Printer 等 Active Directory 網域服務物件的資料。下列表格顯示 Active Directory 網域服務物件之屬性與相對應之 Service Manager 類別內容的對應。

User/Microsoft.AD.User

下表說明 Active Directory User 物件之屬性與 Service Manager Microsoft.AD.User 類別內容的對應。

Active Directory User 屬性 Microsoft.AD.User 內容

physicaldeliveryofficename

Office

displayname

displayname

company

Company

employeeid

Employeeid

department

Department

telephonenumber

BusinessPhone

homePhone

HomePhone

facsimileTelephoneNumber

Fax

mobile

Mobile

pager

Pager

mail

Email

givenname

FirstName

initials

Initials

sn

LastName

distinguishedname

Distinguishedname

title

Title

manager

manager

samaccountname

UserName

l

City

StreetAddress

StreetAddress

st

State

postalCode

Zip

co

Country

localeID

Locale

msRTCSIP-PrimaryUserAddress

SipAddress

objectSid

SID

Domain

Domain

Group/Microsoft.AD.UserBase

下表說明 Active Directory Group 物件之屬性與 Service Manager Microsoft.AD.UserBase 類別內容的對應。

Active Directory Group 屬性 Microsoft.AD.UserBase 內容

displayname

displayname

mail

Email

distinguishedname

Distinguishedname

samaccountname

samaccountname

objectSid

SID

Domain

Domain

Printer/Microsoft.AD.Printer

下表說明 Active Directory PrintQueue 物件之屬性與 Service Manager Microsoft.AD.Printer 類別內容的對應。

Active Directory Printer 屬性 Microsoft.AD.Printer 內容

uNCName

uNCName

serverName

serverName

shortServerName

shortServerName

printerName

printerName

printNetworkAddress

printNetworkAddress

printShareName

printShareName

isDeleted

isDeleted

driverName

driverName

driverVersion

driverVersion

printMemory

printMemory

printCollate

printCollate

printOwner

printOwner

assetNumber

assetNumber

managedBy

managedBy

printDuplexSupported

printDuplexSupported

printColor

printColor

printStaplingSupported

printStaplingSupported

versionNumber

versionNumber

url

url

printMediaSupported

printMediaSupported

printRateUnit

printRateUnit

printMaxXExtent

printMaxXExtent

printKeepPrintedJobs

printKeepPrintedJobs

printRate

printRate

printMediaReady

printMediaReady

printPagesPerMinute

printPagesPerMinute

printMaxResolutionSupported

printMaxResolutionSupported

printMACAddress

printBinNames

printMACAddress

printMACAddress

portName

portName

physicalLocationObject

physicalLocationObject

keywords

keywords

printNotify

printNotify

wWWHomePage

wWWHomePage

whenChanged

whenChanged

modifyTimeStamp

modifyTimeStamp

location

location

canonicalName

canonicalName

displayname

displayname

cn

Fullname

distinguishedname

Distinguishedname

description

description

Computer/Microsoft.Windows.Computer

下表說明 Active Directory Computer 物件之屬性與 Service Manager Microsoft.Windows.Computer 類別內容的對應。

Active Directory Computer 屬性 Microsoft.Windows.Computer 內容

msDS-SiteName

ActiveDirectorySite

dNSHostName

DNSName

ipHostNumber

IPAddress

networkAddress

NetworkName

msDS-PrincipalName

PrincipalName

displayname

displayname

samaccountname

NetbiosComputerName

objectSid

ActiveDirectoryObjectSid

ou

OrganizationalUnit

Domain

NetbiosDomainName