Warning: sem_get() [function.sem-get]: failed for key 0x152b: Permission denied in /home3/adminsky/public_html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 98
AdminSky.org » Command Line

Our Sponsors

Using WMIC install and uninstall software remotely

Using WMIC install and uninstall software remotely

1. Login CMD with domain admin account.

 Runas /user:DomainAdminAccount@DOMAIN cmd

input password when it prompted.

2. Open a WMIC shell with appropriate permissions by running “WMIC” command.

3. Install MSI software remotely

 > /node:COMPUTERNAME product call install true,”" , “c:\Active Directory Janitor 2.0.msi”

4.  Query installed software first and then uninstall selected software

>/node:COMPUTERNAME product get name,version,vendor

>/node:COMPUTERNAME product where name=”Active Directory Janitor 2.0″ call uninstall

5. Install and uninstall software remotel on multiple computers at one time

>/node:@”c:\computers.txt” product where name=”Active Directory Janitor 2.0.msi” call uninstall

> /node:@”c:\computers.txt” product call install true,”" , “c:\Active Directory Janitor 2.0.msi”

SQL – drop XML schema collection

Delete an entire XML schema collection and all of its components.

Syntax
      DROP XML SCHEMA COLLECTION [relational_schema.]sql_identifier

Key
   relational_schema   The relational schema name.
   sql_identifier      The XML schema collection to drop.

You cannot drop an XML schema collection if it is associated with any xml type parameter or column, specified in any table constraints or referenced in a schema-bound function / stored procedure (CREATE FUNCTION … WITH SCHEMABINDING)

Example

DROP XML SCHEMA COLLECTION MySchemaCollection
GO

SQL – alter XML schema collection

Add new schema components to an existing XML schema collection.

Syntax
      ALTER XML SCHEMA COLLECTION [relational_schema.]sql_identifier ADD 'Schema Component'

Key
   relational_schema  The relational schema name.

   sql_identifier     SQL identifier for the XML schema collection.

   Schema Component   The schema component to insert.

This command can be used to add an entirely new XML schema, (namespace not currently in the XML schema collection), or add a new component to an existing namespace in the collection.

Example

ALTER XML SCHEMA COLLECTION MyCollection ADD '
  <schema xmlns="http://www.w3.org/2001/XMLSchema"
         targetNamespace="http://MySchema/my_xml_schema">
     <element name="anotherElement" type="byte"/>
 </schema>'

SQL – create XML schema collection

Import schema components into a database.

Syntax
      CREATE XML SCHEMA COLLECTION [relational_schema.]sql_identifier AS Expression

Key
   relational_schema  The relational schema name.

   sql_identifier     SQL identifier for the XML schema collection.

   Expression         A string constant or scalar variable.
                      (varchar, varbinary, nvarchar, nvarbinary, or xml type)

The variable in the example below is of nvarchar(max) type. The variable can also be of xml data type, in which case, it is implicitly converted to a string.

Example

DECLARE @MySchemaCollection nvarchar(max)
Set @MySchemaCollection  = N' copy the schema collection here'
CREATE XML SCHEMA COLLECTION MyCollection AS @MySchemaCollection

SQL – drop view

Remove one or more views from the current database.

Syntax
      DROP VIEW [schema.] view [...,n ] [;]

Key
   view    Name of the view to be dropped.

DROP VIEW can be executed against indexed views.

Example

DROP VIEW MyView;

Warning: sem_acquire(): supplied argument is not a valid SysV semaphore resource in /home3/adminsky/public_html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 107

Warning: sem_release(): supplied argument is not a valid SysV semaphore resource in /home3/adminsky/public_html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 116