@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
1 lines • 23.7 kB
Source Map (JSON)
{"version":3,"sources":["../../../packages/core/shared/server-inventory/server-inventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAGxE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,cAAc,CAAC,EAAE,+BAA+B,CAAC;CACpD;AAED;;GAEG;AACH,oBAAY,sBAAsB;IAC9B,OAAO,IAAI;IACX,MAAM,IAAI;IACV,YAAY,IAAI;IAChB,QAAQ,IAAI;IACZ,iBAAiB,IAAI;IACrB,mBAAmB,IAAI;IACvB,QAAQ,IAAI;IACZ,iBAAiB,IAAI;IACrB,cAAc,IAAI;IAClB,mBAAmB,IAAI;IACvB,SAAS,KAAK;IACd,iBAAiB,KAAK;IACtB,iBAAiB,KAAK;CACzB;AAED;;GAEG;AACH,oBAAY,kBAAkB;IAC1B,WAAW,IAAI;IACf,gBAAgB,IAAI;IACpB,MAAM,IAAI;CACb;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;MAIE;IACF,gBAAgB,EAAE,MAAM,CAAC;IACzB;;MAEE;IACF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;MAEE;IACF,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;MAEE;IACF,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,2B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;IACI,KAAK,EAAE,MAAM,CAAC;IAErB;;OAEG;IACI,cAAc,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,cAAc,EAAE,kBAAkB,CAAC;IAKnC,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACI,WAAW,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACI,mBAAmB,EAAE,MAAM,CAAC;IAEnC;;OAEG;IACI,6BAA6B,EAAE,MAAM,CAAC;IAE7C;;OAEG;IACI,gBAAgB,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACI,WAAW,EAAE,OAAO,CAAC;IAE5B;;;;;OAKG;gBACgB,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,mBAAmB;IAMjE;;;;OAIG;IACH,IAAW,MAAM,IAAI,OAAO,CAG3B;IAED;;;;OAIG;IACH,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED;;;;OAIG;IACH,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED;;;;OAIG;IACH,IAAW,kBAAkB,IAAI,OAAO,CAIvC;IAED;;OAEG;IACH,IAAW,0BAA0B,IAAI,MAAM,CAE9C;IAED;;OAEG;IACH,IAAW,8BAA8B,IAAI,MAAM,CAElD;IAED;;;OAGG;IACH,IAAW,eAAe,IAAI,sBAAsB,CAsDnD;CACJ","file":"server-inventory.d.ts","sourcesContent":["import { AzureArcStatusEnum } from '../../azure/models/azureArcStatusEnum';\r\nimport { PowerShellSessionRequestOptions } from '../../data/powershell';\r\nimport { MediaConversion, MediaConversionBase } from '../../data/units';\r\n\r\n/**\r\n * Server Inventory query parameters.\r\n */\r\nexport interface ServerInventoryParams {\r\n /**\r\n * name of server node.\r\n */\r\n name: string;\r\n\r\n /**\r\n * options for PowerShell session request.\r\n */\r\n requestOptions?: PowerShellSessionRequestOptions;\r\n}\r\n\r\n/**\r\n * Windows Operating Systems\r\n */\r\nexport enum WindowsOperatingSystem {\r\n Unknown = 0,\r\n Legacy = 1, // XP, Server 2003, Windows NT, etc.\r\n WindowsVista = 2,\r\n Windows7 = 3,\r\n WindowsServer2008 = 4,\r\n WindowsServer2008R2 = 5,\r\n Windows8 = 6,\r\n WindowsServer2012 = 7,\r\n Windows8Point1 = 8,\r\n WindowsServer2012R2 = 9,\r\n Windows10 = 10,\r\n WindowsServer2016 = 11,\r\n WindowsServer2019 = 12\r\n}\r\n\r\n/**\r\n * Windows Product Types\r\n */\r\nexport enum WindowsProductType {\r\n Workstation = 1,\r\n DomainController = 2,\r\n Server = 3\r\n}\r\n\r\n/**\r\n * Smbios Info\r\n */\r\nexport interface SmbiosData {\r\n /**\r\n * indicator of the Serial Number assigned from Company and is accessible on exterior of device.\r\n */\r\n serialNumber: string;\r\n /**\r\n * identifies the company brand name under which the device is marketed to the end user.\r\n */\r\n manufacturer: string;\r\n /**\r\n * This is a unique value and is intended to be associated with this specific machine.\r\n * This can be null depending on the machine\r\n */\r\n uuid: string;\r\n /**\r\n * identifies the baseboard and should accurately reflect\r\n * variances in baseboards across different devices in the same family and product name.\r\n * This can be null depending on the machine\r\n */\r\n baseBoardProduct: string;\r\n /**\r\n * physical frames or structures of a machine\r\n */\r\n chassis: string[];\r\n /**\r\n * Types of Chassis defined in the specification.\r\n */\r\n chassisTypes: string[];\r\n /**\r\n * identifies the company sub-brand name, specific to a grouping of similar devices known as a product line,\r\n * under which the device is marketed to end users\r\n */\r\n systemFamily: string;\r\n /**\r\n * identifies the device in a format that can be determined by Company.\r\n */\r\n systemSkuNumber: string;\r\n\r\n /**\r\n * Asset tag number of the system enclosure\r\n */\r\n smBiosAssetTag: string;\r\n}\r\n\r\n/**\r\n * The address entry for address list.\r\n */\r\nexport interface ServerInventoryAddressEntry {\r\n ipAddress: string;\r\n addressFamily: 'InterNetwork' | 'InterNetworkV6';\r\n}\r\n\r\n/**\r\n * Server Inventory data interface.\r\n */\r\nexport interface ServerInventoryData {\r\n /**\r\n * The server name.\r\n */\r\n serverName: string;\r\n\r\n /**\r\n * The name of server. (CSName/OperatingSystem)\r\n */\r\n name: string;\r\n\r\n /**\r\n * The domain name of server. (Domain/ComputerSystem)\r\n */\r\n domainName: string;\r\n\r\n /**\r\n * The workgroup name of server if any. (Workgroup/ComputerSystem)\r\n */\r\n workgroupName: string;\r\n\r\n /**\r\n * The FQDN of server if any. (ComputerSystem)\r\n */\r\n fullyQualifiedDomainName: string;\r\n\r\n /**\r\n * The FQDN of server if any. (ComputerSystem) Not lower cased.\r\n */\r\n fullyQualifiedDomainNameRaw: string;\r\n\r\n /**\r\n * The hostname of computer which was configured on the computer.\r\n */\r\n hostname: string;\r\n\r\n /**\r\n * The hostname of computer which was configured on the computer. Not lower cased.\r\n */\r\n hostnameRaw: string;\r\n\r\n /**\r\n * The NetBios name which might be trimmed by 15 characters.\r\n */\r\n netBios: string;\r\n\r\n /**\r\n * The IP address list.\r\n */\r\n addressList: ServerInventoryAddressEntry[];\r\n\r\n /**\r\n * The operating system name of server. (Caption/OperatingSystem)\r\n */\r\n operatingSystemName: string;\r\n\r\n /**\r\n * The operating system name of server. (SKU/OperatingSystem)\r\n */\r\n operatingSystemSKU: number;\r\n\r\n /**\r\n * The operating system version of server. (Version/OperatingSystem)\r\n */\r\n operatingSystemVersion: string;\r\n\r\n /**\r\n * The total size of physical memory.\r\n */\r\n totalPhysicalMemory: number;\r\n\r\n /**\r\n * The domain role.\r\n */\r\n domainRole: number;\r\n\r\n /**\r\n * The windows product type.\r\n */\r\n productType: WindowsProductType;\r\n\r\n /**\r\n * The computer manufacturer.\r\n */\r\n computerManufacturer: string;\r\n\r\n /**\r\n * The computer model.\r\n */\r\n computerModel: string;\r\n\r\n /**\r\n * The number of logical processors.\r\n */\r\n totalLogicalProcessors: number;\r\n\r\n /**\r\n * Indicating if the server has ManagementTools namespace to support TaskManager provider.\r\n */\r\n isManagementToolsAvailable: boolean;\r\n\r\n /**\r\n * Indicating if the computer has ServerManager namespace to support ServerManager provider.\r\n */\r\n isServerManagerAvailable: boolean;\r\n\r\n /**\r\n * Whether or not Windows Management Framework v5.0 or higher is installed.\r\n */\r\n isWmfInstalled: boolean;\r\n\r\n /**\r\n * Indicating if the server node is a part of Microsoft Cluster.\r\n */\r\n isCluster: boolean;\r\n\r\n /**\r\n * The FQDN of Microsoft Cluster if it's a part of Microsoft Cluster.\r\n */\r\n clusterFqdn: string;\r\n\r\n /**\r\n * Indicating if current user is a member of administrators group.\r\n */\r\n isAdministrator: boolean;\r\n\r\n /**\r\n * Indicates if the node has S2D enabled\r\n */\r\n isS2dEnabled: boolean;\r\n\r\n /**\r\n * Indicates if the node has Britannica enabled\r\n */\r\n isBritannicaEnabled: boolean;\r\n\r\n /**\r\n * Indicates if the hyper-v role is installed\r\n */\r\n isHyperVRoleInstalled: boolean;\r\n\r\n /**\r\n * Indicates if the hyper-v powershell feature is installed\r\n */\r\n isHyperVPowershellInstalled: boolean;\r\n\r\n /**\r\n * Indicates if CredSSP is enabled.\r\n */\r\n isCredSSPEnabled: boolean;\r\n\r\n /**\r\n * Indicating if remote app enabled.\r\n */\r\n isRemoteAppEnabled: boolean;\r\n\r\n /**\r\n * SMBIOS Data\r\n */\r\n smbiosData: SmbiosData;\r\n\r\n /**\r\n * The system lockdown policy enforcement mode.\r\n */\r\n systemLockdownPolicy: string;\r\n\r\n /**\r\n * Type of operating system value\r\n */\r\n osType: string;\r\n\r\n /**\r\n * Product name that a manufacturer gives to a computer\r\n */\r\n model: string;\r\n\r\n /**\r\n * Last reboot time\r\n */\r\n lastBootUpTime: string;\r\n\r\n /**\r\n * The status of the azure arc in the server\r\n * i.e connectioned, disconnected etc\r\n */\r\n azureArcStatus: AzureArcStatusEnum;\r\n\r\n /**\r\n * The operating system build number\r\n */\r\n buildNumber: string;\r\n\r\n /**\r\n * The operating system update build revision\r\n */\r\n updateBuildRevision: number;\r\n\r\n /**\r\n * The operating system display version eg: 22H2\r\n */\r\n operatingSystemDisplayVersion: string;\r\n\r\n /**\r\n * The installation type of the operating system\r\n */\r\n installationType: string;\r\n\r\n /**\r\n * Indicating if the server is HCI.\r\n */\r\n isHciServer: boolean;\r\n}\r\n\r\n/**\r\n * Server Inventory class.\r\n */\r\nexport class ServerInventory implements ServerInventoryData {\r\n private static nanoDisplayFormat = '{0} Nano';\r\n private static server19PreviewBuildNumber = 17623;\r\n\r\n /*\r\n * OperatingSystemSKU: from https://msdn.microsoft.com/en-us/library/aa394239(v=vs.85).aspx\r\n * PRODUCT_DATACENTER_NANO_SERVER (143)\r\n * Windows Server Datacenter Edition (Nano Server installation)\r\n * PRODUCT_STANDARD_NANO_SERVER (144)\r\n * Windows Server Standard Edition (Nano Server installation)\r\n */\r\n private static nanoServerSkus: number[] = [143, 144];\r\n\r\n /**\r\n * The name of server. (CSName/OperatingSystem)\r\n */\r\n public name: string;\r\n\r\n /**\r\n * The domain name of server. (Domain/ComputerSystem)\r\n */\r\n public domainName: string;\r\n\r\n /**\r\n * The workgroup name of server if any. (Workgroup/ComputerSystem)\r\n */\r\n public workgroupName: string;\r\n\r\n /**\r\n * The FQDN of server if any. (ComputerSystem)\r\n */\r\n public fullyQualifiedDomainName: string;\r\n\r\n /**\r\n * The FQDN of server if any. (ComputerSystem) Not lower cased.\r\n */\r\n public fullyQualifiedDomainNameRaw: string;\r\n\r\n /**\r\n * The hostname of computer which was configured on the computer.\r\n */\r\n public hostname: string;\r\n\r\n /**\r\n * The hostname of computer which was configured on the computer. Not lower cased.\r\n */\r\n public hostnameRaw: string;\r\n\r\n /**\r\n * The NetBios name which might be trimmed by 15 characters.\r\n */\r\n public netBios: string;\r\n\r\n /**\r\n * The IP address list.\r\n */\r\n public addressList: ServerInventoryAddressEntry[];\r\n\r\n /**\r\n * The operating system name of server. (Caption/OperatingSystem)\r\n */\r\n public operatingSystemName: string;\r\n\r\n /**\r\n * The operating system name of server. (SKU/OperatingSystem)\r\n */\r\n public operatingSystemSKU: number;\r\n\r\n /**\r\n * The operating system version of server. (Version/OperatingSystem)\r\n */\r\n public operatingSystemVersion: string;\r\n\r\n /**\r\n * The total size of physical memory.\r\n */\r\n public totalPhysicalMemory: number;\r\n\r\n /**\r\n * The domain role.\r\n */\r\n public domainRole: number;\r\n\r\n /**\r\n * The windows product type.\r\n */\r\n public productType: WindowsProductType;\r\n\r\n /**\r\n * The computer manufacturer.\r\n */\r\n public computerManufacturer: string;\r\n\r\n /**\r\n * The computer model.\r\n */\r\n public computerModel: string;\r\n\r\n /**\r\n * The number of logical processors.\r\n */\r\n public totalLogicalProcessors: number;\r\n\r\n /**\r\n * Indicating if the server has ManagementTools namespace to support TaskManager provider.\r\n */\r\n public isManagementToolsAvailable: boolean;\r\n\r\n /**\r\n * Indicating if the computer has ServerManager namespace to support ServerManager provider.\r\n */\r\n public isServerManagerAvailable: boolean;\r\n\r\n /**\r\n * Whether or not Windows Management Framework v5.0 or higher is installed.\r\n */\r\n public isWmfInstalled: boolean;\r\n\r\n /**\r\n * Indicating if the server node is a part of Microsoft Cluster.\r\n */\r\n public isCluster: boolean;\r\n\r\n /**\r\n * The FQDN of Microsoft Cluster if it's a part of Microsoft Cluster.\r\n */\r\n public clusterFqdn: string;\r\n\r\n /**\r\n * Indicating if current user is a member of administrators group.\r\n */\r\n public isAdministrator: boolean;\r\n\r\n /**\r\n * Indicates if the node has S2D enabled\r\n */\r\n public isS2dEnabled: boolean;\r\n\r\n /**\r\n * Indicates if the node has Britannica enabled\r\n */\r\n public isBritannicaEnabled: boolean;\r\n\r\n /**\r\n * Indicates if the hyper-v role is installed\r\n */\r\n public isHyperVRoleInstalled: boolean;\r\n\r\n /**\r\n * Indicates if the hyper-v powershell feature is installed\r\n */\r\n public isHyperVPowershellInstalled: boolean;\r\n\r\n /**\r\n * Indicates if CredSSP is enabled.\r\n */\r\n public isCredSSPEnabled: boolean;\r\n\r\n /**\r\n * Indicating if remote app enabled.\r\n */\r\n public isRemoteAppEnabled: boolean;\r\n\r\n /**\r\n * SMBIOS Data\r\n */\r\n public smbiosData: SmbiosData;\r\n\r\n /**\r\n * The system lockdown policy enforcement mode.\r\n */\r\n public systemLockdownPolicy: string;\r\n\r\n /**\r\n * Type of operating system value\r\n */\r\n public osType: string;\r\n\r\n /**\r\n * Product name that a manufacturer gives to a computer\r\n */\r\n public model: string;\r\n\r\n /**\r\n * Last reboot time\r\n */\r\n public lastBootUpTime: string;\r\n\r\n /**\r\n * The status of the azure arc in the server\r\n * i.e connectioned, disconnected etc\r\n */\r\n azureArcStatus: AzureArcStatusEnum;\r\n\r\n /*\r\n * Operating system serial number\r\n */\r\n osSerialNumber: string;\r\n\r\n /**\r\n * The operating system build number\r\n */\r\n public buildNumber: string;\r\n\r\n /**\r\n * The operating system update build revision\r\n */\r\n public updateBuildRevision: number;\r\n\r\n /**\r\n * The operating system display version eg: 22H2\r\n */\r\n public operatingSystemDisplayVersion: string;\r\n\r\n /**\r\n * The installation type of the operating system\r\n */\r\n public installationType: string;\r\n\r\n /**\r\n * Indicating if the server is HCI.\r\n */\r\n public isHciServer: boolean;\r\n\r\n /**\r\n * Initializes a new instance of the ServerInventory Class.\r\n *\r\n * @param serverName the server name to query.\r\n * @param data the server inventory recovered data.\r\n */\r\n constructor(public serverName: string, data?: ServerInventoryData) {\r\n if (data) {\r\n Object.assign(this, data);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the sku number indicating whether the computer is Nano server.\r\n *\r\n * @return boolean true if nano\r\n */\r\n public get isNano(): boolean {\r\n // given sku number is in nanoServerSkus array?\r\n return ServerInventory.nanoServerSkus.indexOf(this.operatingSystemSKU) > -1;\r\n }\r\n\r\n /**\r\n * Gets a value indicating if this is a windows server\r\n *\r\n * @return boolean true if this is a server\r\n */\r\n public get isServer(): boolean {\r\n return this.productType === WindowsProductType.Server;\r\n }\r\n\r\n /**\r\n * Gets a value indicating if this is a windows client\r\n *\r\n * @return boolean true if this is a client\r\n */\r\n public get isClient(): boolean {\r\n return this.productType === WindowsProductType.Workstation;\r\n }\r\n\r\n /**\r\n * Indicates whether the computer is domain controller or not.\r\n *\r\n * @return boolean true if domain controller\r\n */\r\n public get isDomainController(): boolean {\r\n // As per https://msdn.microsoft.com/en-us/library/windows/desktop/aa394102(v=vs.85)\r\n // domainRole of 4 or 5 means it's a domain controller.\r\n return (this.domainRole === 4 || this.domainRole === 5);\r\n }\r\n\r\n /**\r\n * Gets the display name of operating system.\r\n */\r\n public get operatingSystemDisplayName(): string {\r\n return this.isNano ? ServerInventory.nanoDisplayFormat.format(this.operatingSystemName) : this.operatingSystemName;\r\n }\r\n\r\n /**\r\n * Gets the display name of total physical memory.\r\n */\r\n public get totalPhysicalMemoryDisplayName(): string {\r\n return MediaConversion.getConvertedValue(this.totalPhysicalMemory, MediaConversionBase.Binary);\r\n }\r\n\r\n /**\r\n * Gets the operating system enumb of the machine\r\n * see: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx for operating system version mapping.\r\n */\r\n public get operatingSystem(): WindowsOperatingSystem {\r\n\r\n if (!this.operatingSystemVersion) {\r\n return WindowsOperatingSystem.Unknown;\r\n }\r\n\r\n // windows 10, server 2016, and server 2019\r\n // report anything newer as one of these options.\r\n if (this.operatingSystemVersion.indexOf('.') > 1) {\r\n // since . is more than 2 digits from the start of the screen we are going to assume its '10.', '11.', etc...\r\n if (this.isServer) {\r\n if (+this.operatingSystemVersion.split('.').last() >= ServerInventory.server19PreviewBuildNumber) {\r\n // 17623 first insiders preview of 2019\r\n return WindowsOperatingSystem.WindowsServer2019;\r\n } else {\r\n // 14393 official release version of 2016\r\n // fall back to 2016 for versions between 14393 and 17623\r\n return WindowsOperatingSystem.WindowsServer2016;\r\n }\r\n } else {\r\n return WindowsOperatingSystem.Windows10;\r\n }\r\n }\r\n\r\n // windows 8.1 and server 2012r2\r\n if (this.operatingSystemVersion.startsWith('6.3')) {\r\n return this.isServer\r\n ? WindowsOperatingSystem.WindowsServer2012R2\r\n : WindowsOperatingSystem.Windows8Point1;\r\n }\r\n\r\n // windows 8 and server 2012\r\n if (this.operatingSystemVersion.startsWith('6.2')) {\r\n return this.isServer\r\n ? WindowsOperatingSystem.WindowsServer2012\r\n : WindowsOperatingSystem.Windows8;\r\n }\r\n\r\n // windows 7 and server 2008 R2\r\n if (this.operatingSystemVersion.startsWith('6.1')) {\r\n return this.isServer\r\n ? WindowsOperatingSystem.WindowsServer2008R2\r\n : WindowsOperatingSystem.Windows7;\r\n }\r\n\r\n // windows vista and server 2008\r\n if (this.operatingSystemVersion.startsWith('6.0')) {\r\n return this.isServer\r\n ? WindowsOperatingSystem.WindowsServer2008\r\n : WindowsOperatingSystem.WindowsVista;\r\n }\r\n\r\n // assume a legacy os that somehow was able to run powershell.(unlikely)\r\n return WindowsOperatingSystem.Legacy;\r\n }\r\n}\r\n"]}