Přeskočit na hlavní obsah

ExportUtil (Automatic Translation)

Popis funkce

Aplikace se používá pro export objektů ze systému ALVAO Asset Management do standardního CSV souboru. Vyváží pouze aktiva aktivního inventáře, , tj. kromě „vyřazených aktiv“, „koše“ a jiných systémových objektů. Tato funkce je k dispozici pouze pro uživatele s premise

Syntax příkazové řádky

ExportUtil /csv*"path and name of CSV file"* { /con*"connection string"| /server"database server name"/db"database name"*} /cols"list sloupců" [ /NotEmpty"column name"] [ /TemplateFolder"] [ /where {[@class] | [@name] | [@path] | [<object property name>]}<operator><value>]

Podrobný popis parametrů

ParametrPopis
/csv

Cesta a název souboru CSV, kde budou uloženy informace o objektu .

/con /server /db

Tyto parametry se používají k nastavení připojení k databázi Alvao . Je možné použít připojovací řetězec (např. /con "Zdroj dat" =. sqlexpress;Initial Catalog=test;Integrated Security = True;TrustServerCertificate=True"), nebo jednoduše zadejte specifický SQL server a DB (např. /server ".\sqlexpress" /db "test").

In case you use the /server parameters and /db, the database connection is made using Windows Integrated Authentication. If you specify all these parameters, only /con is used parameter, /server and /db will be ignored.

/cols

Column definitions that will be exported to the output file. See below.

/NotEmpty

This parameter is for backwards compatibility and will be removed in future versions. We recommend using the /where parameter instead. It only exports objects where the value of a specific object property is not an empty value.

Note: The property name can be written without diacritics.

/TemplateFolder

This parameter is for backwards compatibility and will be removed in future versions. We recommend using the /where parameter instead. It only exports certain types of objects lying in object templates under a certain folder. The parameter is the folder name.

Note: The folder name can be written without diacritics.

/where

Used to filter exported objects by type, name, path in the tree, and property values. Follow the switch with the logical filter expression in quotes. All objects for which the expression is satisfied will be exported.

You can use the following variables in the expression:

  • [@class] - object type
  • [@name] - name of the object in the tree
  • [@path] - path in the tree, the "/" character is used as a level separator
  • [<object property name>] - value of a certain object property, e.g. [Serial number].

Note: property names can be entered without diacritics.

Constants:

  • N'<text constant>' - text in unicode, e.g. N'David Cooper'.
  • '<text constant>' - text in ASCII (without diacritics), e.g. 'Serial number'.
  • <numeric constant> - e.g. 12.

Operators:

  • = - equals, e.g., [@class]=N'Computer/server'
  • !=, <> - does not equal, e.g. [@class]<>N'Computer/server'
  • IN - value equals one of the specified values, e.g. [@class]IN (N'Computer/server', N'Computer/virtual')
  • LIKE - string comparison with the possibility of using simple regular expressions. E.g., object type starting with 'Computer/': [@class] LIKE N'Computer/%')
  • NOT - negation of IN or LIKE operators, e.g. [@class] NOT LIKE N'Computer/%')
  • IS NULL - the value is NULL - e.g. the object does not have the property Serial number: [Serial number] IS NULL.

You can concatenate parts of an expression using AND and OR operators.

Poznámka

The format of the expression corresponds to the WHERE expression in SQL.

Popis podporovaných sloupců

Sloupce jsou nastaveny v parametru /cols jsou odděleny čárkou. Doporučujeme zahrnout celou hodnotu parametru do uvozovek.

Sloupec**Význam **Příklad hodnoty
@id

Jedinečný identifikátor (INT číslo) objektu v databázi Správa aktiv (NodeId).

1245
@nameNázev objektu ve stromu objektů.HP LP2475w, LCD, 24"
@classtyp objektu.Monitor
@pathCesta k objektu ve stromu objektů.Contoso/Londýn/Peter Jenkins
@adguid

GUID identifikátor objektu z Active Directory (obsahuje hodnotu, pokud byl objekt vytvořen nebo spárován pomocí AD import).

{f50c0d0f-fede-4aaa-9509-7632e48251cc}
[vlastnosti objektu]

Jakákoli vlastnost objektu. Vlastnosti musí být zapsány v hranatých závorkách .

Poznámka: Název vlastnosti může být zvýrazněn nebo bez zvýraznění.

SN1234

Example of parameter value: "@id,@name,@path,@class,[serial number],[inventory number],[name in network]"

Scenarios

Exportovat objekty, které mají hodnotu v vlastnosti "Číslo inventáře"

ExportUtil.exe /csv "c:\data\objects.csv" /server server\sql2005 /db alvao /cols "@id,@name,@path,@class,[sériové číslo],[číslo inventury],[hostname]" /where "[číslo inventury]!=''"

Exportovat všechny objekty, kde je objektová šablona ve složce "IT aktiva" v šablonách objektů

ExportUtil.exe /csv "c:\data\objects. sv" /server server\sql2005 /db alvao /cols "@id,@name,@path,@class,[sériové číslo],[hostname]" /where "[@class] IN (SELECT txtClass FROM vNodeClass WHERE txtPath LIKE N'Object Templates/Inventář IT%')"

Exportovat všechny mobilní telefony

ExportUtil.exe /csv "c:\data\objects.csv" /server server\sql2005 /db alvao /cols "@id,@name,@path,@class,[sériové číslo],[hostname]/where "[@class]=N'Mobile phone'" "

Exportovat všechny mobilní telefony iPhone 7

ExportUtil.exe /csv "c:\data\objects.csv" /server server\sql2005 /db alvao /cols "@id,@name,@path,@class,[sériové číslo],[hostname]/where "[@class]=N'Mobilní telefon" A [Model]=N'iPhone 7'"

Export všech mobilních telefonů v londýnské pobočce

ExportUtil.exe /csv "c:\data\objects.csv" /server server\sql2005 /db alvao /cols "@id,@name,@path,@class,[sériové číslo],[hostname]/where "[@class]=N'Mobile phone' AND [@path] LIKE N'Contoso/London/%'"