This spreadsheet is for the batch querying of multiple objects of the same type. WINNT attributes can be specified and compared against lists of objects in columns.
The control buttons on the left hand side perform the following function:
Button |
Functionality |
Read |
Will read the objects specified in column F on the clients or servers specified in column E. The object properties specified in the header rows of columns G and higher will be populated |
Update |
Will generate two Excel sheets called "Update.ps1" and "Rollback.ps1". Update.ps1 contains a powershell script that can be used by an administrator, The script will contain a series of commands that update the object with the attribute values specified in columns G and higher. Rollback.ps1 will contain a complete reversal script that reverts the objects back to their original state. |
Clear Results |
Clears the contents of columns G and higher leaving the column headers intact. |
Reading Objects
When reading Objects specified in column E and F objects will be read sequential starting in cell E2 and continuing in column E until an empty cell is found.
Populate the WINNT properties you wish to read as the headers of columns G and higher.
Populate the objects that are to be read in column E and F and select the "Read" button.
The error result of the reading objects will be displayed in column D:
Result |
|
OK |
The object has been read successfully |
Not found |
The object or attribute cannot be found |
Error |
There is an error reading the object or attribute |
Updating objects
Populate the names of the objects in column E and F, the names of the attributes in row 1. If the objects need to be validated select read.
Complete the attribute column values to those that are to be updated. Empty cells will be ignored, if an attribute needs to be cleared then type NULL in the cells corresponding to the object that needs the attribute cleared.
Once the spreadsheet is populated set Create object B16 to no and select the update button.
The update.ps1 and rollback.ps1 sheets will be deleted and recreated with powershell scripts that can be used to update objects.
Creating objects
The object category is specified in B15 is only used for creating objects, this can either be;
- User
- Group
Set B16 Create object to "Yes"
Populate the names of the objects in column E and F the names of the attributes in row 1. If the objects need to be validated as not existing select read
Complete the attribute column values to those that are to be created
Creating Local Users
Local user accounts on workstations or servers can be created without any attributes unless there is a password complexity policy on the computer policy. A password must be added that meets the complexity requirements policy. In most organisations this is a minimum of 8 characters and in secure environment this will need to include at least 1 number 1 lowercase character and 1 uppercase character.
The following attributes will typically be used to create user accounts.
Propery |
Description |
Fullname |
The full name of the user (last, first) |
Password |
Must meet complexity requirements policy |
If the users require access to terminal services then terminal services attributes can be added.
Creating Local Groups
Local groups on workstations or servers can be created without any attributes.
A typical set of attributes to specify when creating groups.
Property |
Description |
Description |
A description of the groups purpose |
The membership of local groups can be amended using a group membership specific spreadsheet
Generating and executing poweshell scripts
Once the spreadsheet is populated with objects and attribute values select the Update button.
The tabs."Update.ps1" and "Rollback.ps1" will be created or if already there deleted and recreated.
Send the spreadsheet to your AD administrator to perform the following activities:
Copy the scripts to text files
Within the "update.ps1" sheet highlight column A, right click and select copy.
Create a new text file e.g. c:\script\update.ps1
Paste the contents of column A into the text file, either use notepad or a powershell editor.
Save the file and repeat for "rollback.ps1"
The powershell script update.ps1 can now be run at a command line or within a powershell editor
Once update.ps1 is run, there will be no output on the command line if the script executes without error. Errors will be outputted in red text. The script will output the csv file into its execution directory called Result.csv.
For each object processed the following results will be outputted:
Column |
Result |
Object |
The name of the object that has been processed in the script |
Error |
An integer counting the number of errors processing the object in the script, If 0 Then No Error |
Description |
Description , The description of the last error processing the object in the script, If Empty then No Error |
If a rollback is required then the rollback.ps1 script can be run.
- Details
- Category: Client Server
- Published: 04 November 2013