wdsutil get-device
Applies to: Windows Server (Semi-Annual Channel), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Retrieves Windows Deployment Services information about a prestaged computer (that is, a physical computer that has been lined to a computer account in active directory Domain Services.
Syntax
Parameters
Parameter | Description |
---|---|
/Device: | Specifies the name of the computer (SAMAccountName). |
/ID: | Specifies either the MAC address or the UUID (GUID) of the computer, as shown in the following examples. Note that a valid GUID must be in one of two formats binary string or GUID string |
— Binary string: /ID:ACEFA3E81F20694E953EB2DAA1E8B1B6
— MAC address: 00B056882FDC (no dashes) or 00-B0-56-88-2F-DC (with dashes)
— GUID string: /ID:E8A3EFAC-201F-4E69-953-B2DAA1E8B1B6
Examples
To get information by using the computer name, type:
To get information by using the MAC address, type:
To get information by using the GUID string, type:
WDSUTIL Get-Device wdsutil get-device
Область применения: Windows Server (половина ежегодного канала), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Applies to: Windows Server (Semi-Annual Channel), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Извлекает сведения о службах развертывания Windows о предварительно подготовленном компьютере (т. е. физическом компьютере, который был подключен к учетной записи компьютера в доменных службах Active Directory). Retrieves Windows Deployment Services information about a prestaged computer (that is, a physical computer that has been lined to a computer account in active directory Domain Services.
Синтаксис Syntax
Параметры Parameters
Параметр Parameter | Описание Description |
---|---|
Модем /Device: | Указывает имя компьютера (SAMAccountName). Specifies the name of the computer (SAMAccountName). |
Удостоверения /ID: | Указывает MAC-адрес или UUID (GUID) компьютера, как показано в следующих примерах. Specifies either the MAC address or the UUID (GUID) of the computer, as shown in the following examples. Обратите внимание, что допустимый GUID должен быть в одном из двух форматов двоичная строка или строка GUID Note that a valid GUID must be in one of two formats binary string or GUID string |
— Двоичная строка:/ID: ACEFA3E81F20694E953EB2DAA1E8B1B6 — Binary string: /ID:ACEFA3E81F20694E953EB2DAA1E8B1B6
— MAC-адрес: 00B056882FDC (без дефисов) или 00-B0-56-88-2F-DC (с тире) — MAC address: 00B056882FDC (no dashes) or 00-B0-56-88-2F-DC (with dashes)
— Строка GUID:/ID: E8A3EFAC-201F-4E69-953-B2DAA1E8B1B6 — GUID string: /ID:E8A3EFAC-201F-4E69-953-B2DAA1E8B1B6
Примеры Examples
Чтобы получить сведения, используя имя компьютера, введите: To get information by using the computer name, type:
Чтобы получить сведения с помощью MAC-адреса, введите: To get information by using the MAC address, type:
Чтобы получить сведения с помощью строки GUID, введите: To get information by using the GUID string, type:
codefoster
- Content
- About Me
- Presentations
- Categories
- App Development 21
- Azure 7
- Blogging 7
- Bot Framework 1
- Bots 1
- C# 2
- Code 6
- Community 1
- Design 14
- Developer Community 1
- Developer Stories 5
- Developer Tools 4
- Events 16
- HTML/CSS 11
- IDE 4
- IoT 3
- JavaScript 20
- Linux 1
- Machine Learning 1
- Maker 18
- Node.js 5
- Other 37
- Personal 2
- Personal Development 1
- Productivity 18
- Software 2
- Student 2
- Students 1
- UI/UX 3
- Windows 13
- Tags
- 3d
- 3d-printing
- 8 tracks
- Node
- Node.js
- add-ons
- ai
- airbnb
- algorithms
- anonymous
- api
- app
- app development
- appathon
- apps
- args
- arm
- arrays
- art
- async
- atom
- az
- azure
- azure-portal
- azure-web-apps
- azure-webapps
- backend
- balance
- bash
- bay-area
- beauty
- bettercms
- bitcoin
- ble
- blockchain
- blog
- blog engine
- blogengine
- bluetooth
- board
- boise
- book
- bot
- bot-framework
- bots
- brackets
- brain
- brain.js
- bridge
- build
- business
- buttons
- caap
- cad
- calendar
- candy
- certification
- charity
- chatbot
- children
- cli
- cloud
- cloud-data
- cloud-storage
- code
- code folding
- codecamp
- cognitive-services
- collapse
- collections
- college
- color
- command line
- command-line
- comments
- community
- conference
- config
- convenient
- creative
- cross platform
- csharp
- css
- css properties
- css property
- culture
- data
- database
- declarative
- design
- design language
- desktop
- destructuring
- dev
- dev radio
- developer
- developer tools
- developer-community
- developer-joy
- developers
- device
- devices
- diet
- discipline
- dispenser
- disqus
- dnn
- dns
- docdb
- docs
- document-db
- documentation
- documentdb
- domain
- domain-names
- downloads
- easy
- eating
- ecmascript
- edge
- editor
- education
- efficiency
- electronics
- energy
- error
- es6
- event
- events
- exam
- exams
- exercise
- expand
- express
- extensibility
- extensions
- feed
- fitness
- fold
- folding
- food
- functional
- functions
- gateway
- gist
- git
- github
- give
- giveaway
- good
- gpio
- graphics
- hackathon
- hardware
- health
- help
- hexo
- html
- icons
- ics
- ide
- illustrations
- images
- innovation
- internet-of-things
- iot
- iot-edge
- ip cam
- ip camera
- javascript
- js
- launch
- learn
- learning
- legal
- lemoon
- license
- life-hacks
- links
- linux
- mac
- magnifier
- make
- maker
- maker-faire
- material
- meal
- meals
- meaning
- media
- meetup
- metro
- minimalism
- ml
- mobile
- mobile development
- mongo
- monitors
- music
- music app
- mva
- namecheap
- nav
- networking
- node
- node-js
- node.js
- nodejs
- notifications
- npm
- observable
- observables
- onedrive
- organization
- oss
- peer-to-peer
- performance
- personal-development
- pi
- plagiarize
- presentations
- produce
- producer
- productivity
- programming
- promise
- promises
- pseudoclass
- publish
- push server
- raspberry
- raspberry-pi
- raspberrypi
- raspbian
- reactive-extensions
- reference
- references
- region
- regression
- resource
- resources
- router
- row
- rowing
- rx
- rxjs
- sample
- san-francisco
- school
- scp
- screen
- screen-capture
- seattle
- server
- settings
- sf
- sfo
- snippets
- soc
- socket.io
- soft skills
- soft-skills
- software
- source code
- source-control
- spread operator
- ssh
- standards
- startup
- state
- streams
- student
- style
- styles
- styling
- sublime
- supervised
- taskbar
- tasks
- tcp
- team
- teamwork
- tech
- technology
- terms
- text
- theme
- things
- tick
- tile
- tiles
- time
- timer
- timing
- tip
- toast
- tooling
- train
- training
- truth
- types
- typescript
- ubuntu
- ui
- ui/ux
- university
- user interface
- ux
- video
- visual studio
- visual-studio
- vitamins
- vnext
- vscode
- wait
- wearable
- web
- web-sockets
- webcam
- webserver
- website
- windows
- windows-8
- windows-phone
- winjs
- wireless
- wordpress
- writing
- xaml
- zoom
- Archives
- 2019 2
- 2018 11
- 2017 16
- 2016 20
- 2015 20
- 2014 39
- 2013 28
- 2012 95
Getting Windows Device Info
I have plenty of experience in the C# space with accessing Windows API, but I’m still finding it rather novel and delightful to do the same thing in JavaScript. The fact that I can do something like…
…is just slick. That’s all. There’s no interop’ing, no dll loading, no service calls. WinRT just delivers it to my front door and doesn’t even make me sign.
Recently, I went looking for how to enumerate the devices currently recognized by the system and found it to be quite nice and thought I’d share.
I started by creating a ListView and an item template in the HTML and imperatively binding that to a WinJS.Binding.List in my JavaScript file. In the interest of being DRY, I won’t walk through that process, but you can see the concept here.
With a ListView and a WinJS.Binding.List in place and with the two hooked together, we’re ready to just fetch our device information and push it into the List. I’ll just lay out all the JS code at once and then explain. Perhaps it will be self-explanatory.
If you follow me much, you likely know that my code tends to be rather dense. I like using the horizontal space that God (and Visual Studio) gave me instead of wearing out my enter key and your scroll wheel. So there are a few things going on in this relatively short snippet.
First, I’m calling into Windows.Devices.Enumeration.DeviceInformation and calling findAllAsync(). That will asynchronously return all of the devices found on the system.
.done() is how we proceed with the results of an asynchronous call in case you haven’t seen that before, and we have a chance to capture the async payload (in this case a bunch of devices) by specifying a devices paramter.
Next, I’m calling a few array functions.
The filter function takes a lambda function and in this case I’m only concerned with devices that have a name and are enabled.
The distinct function is my own. If you want the code for that one, leave me a comment. It reduces the array to only those with unique entries, and it gives you an opportunity to specify what you mean by “unique$rdquo;. In this case, I’m saying that two devices are distinct if their name values are distinct.
Then I do a fancy forEach on the array. Notice how all of these array functions themselves return arrays making it convenient to chain functions together. The forEach function simply calls the provided function on each of the items in the list. No more (or far fewer at least) awkward for iterations. Yay!
In this forEach function, I’m doing another async call — this time to retrieve the Windows 8-style, super fancy glyph graphic to represent the device (hint: you can also call getThumbnailAsync() to get a boring, old-style, full color, supposedly realistic icon for each device.
When the call returns, I create an anonymous object shaped like the data that my template is expecting and push it into my WinJS.Binding.List. Just like that.
A little bit of CSS work later we have something that looks like this…
If you have any questions, just leave a comment and I’ll approve and respond as soon as I can.