New to Kestra?
Use blueprints to kickstart your first workflows.
Create a user account on an existing VM with PowerShell and register it as a typed VM.User asset in Kestra, capturing role and compliance metadata for audits.
Local accounts on servers are a classic audit blind spot: created during an incident or an onboarding, then never inventoried again. This blueprint creates a user account on an existing virtual machine using PowerShell and registers the account as a typed io.kestra.plugin.ee.assets.VM.User asset in the Kestra asset catalog, capturing the role and a compliance flag as metadata. Because the VM is declared as an input asset, the catalog records exactly which accounts exist on which machines, and access reviews become metadata queries.
target_vm input names an existing VM and username names the account to create (defaults windows-web-01 and admin_user).create_windows_user task (io.kestra.plugin.scripts.powershell.Script) simulates the account creation with a Write-Output. In production you replace it with real logic such as New-LocalUser and Add-LocalGroupMember, executed on the target through your remoting mechanism.assets.inputs entry using its slugified id, wiring the account into the machine's lineage.assets.outputs entry of type io.kestra.plugin.ee.assets.VM.User, keyed by the slugified username plus execution id, with metadata for role, compliance_check, and the host vm.VM.User asset per onboarded account, with role and compliance metadata.assets(metadata={"role": "admin"}) lists every admin account registered through the flow.PowerShell creates the account, but nothing native records that it happened, on which machine, with which role. Kestra pairs the action with the record: the same task that provisions the user registers it as a typed asset, so the inventory is generated by the workflow itself and cannot drift. Full execution history gives you the who-when audit trail, and the assets() function turns access reviews into one-line queries inside other flows.
asset-create-vm blueprint, matching the slugified target_vm value.asset-create-vm so the target VM exists in the catalog.target_vm and a username.VM.User asset with its role metadata and lineage.role and compliance_check metadata to match your access model.Write-Output with New-LocalUser plus group membership, executed over WinRM or SSH.io.kestra.plugin.core.flow.Pause before creating admin accounts.role as a SELECT input and map it to different group memberships.