in order to collect who is logging on to Server via Remote Sessions and event subscription can be created with the following XML filters
*[System[(EventID=4624 or EventID=4625)]] and *[EventData[Data[@Name=’LogonType’] and Data=10]]
in order to collect who is logging on to Server via Remote Sessions and event subscription can be created with the following XML filters
*[System[(EventID=4624 or EventID=4625)]] and *[EventData[Data[@Name=’LogonType’] and Data=10]]
1 |
Get-WmiObject win32_service -computer gdc-slo-p-slg01 |select-object @{Label="Server Name"; Expression={$_.__SERVER}}, Name , Startname |ConvertTo-HTML | Out-File "C:\test.htm" |
Get Services on remote computer and save to file
1 2 3 4 |
foreach ($computer in $computerlist ) { Write-Host $computer +" - Admin list" (Get-LocalGroupMembers $computer).members } |
Loads a list of computes and looks who is in the admin group
* get-localGroupMembers is a function:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
<span class="powerShell__keyword">function</span> Get<span class="powerShell__operator">-</span>LocalGroupMembers { <span class="powerShell__keyword">param</span>( [parameter(Mandatory=<span class="powerShell__variable">$true</span>,ValueFromPipeline=<span class="powerShell__variable">$true</span>,ValueFromPipelineByPropertyName=<span class="powerShell__variable">$true</span>)] [Alias(<span class="powerShell__string">"Name"</span>)] [string]<span class="powerShell__variable">$ComputerName</span>, [string]<span class="powerShell__variable">$GroupName</span> = <span class="powerShell__string">"Administrators"</span> ) <span class="powerShell__keyword">begin</span> {} <span class="powerShell__keyword">process</span> { <span class="powerShell__com"># If the account name of the computer object was passed in, it will </span> <span class="powerShell__com"># end with a $. Get rid of it so it doesn't screw up the WMI query. </span> <span class="powerShell__variable">$ComputerName</span> = <span class="powerShell__variable">$ComputerName</span>.Replace(<span class="powerShell__string">"`$"</span>, <span class="powerShell__string">''</span>) <span class="powerShell__com"># Initialize an array to hold the results of our query. </span> <span class="powerShell__variable">$arr</span> = @() <span class="powerShell__com"># Get hostname of remote system. $computername could reference cluster/alias name. Need real hostname for subsequent WMI query.</span> <span class="powerShell__variable">$hostname</span> = (<span class="powerShell__cmdlets">Get-WmiObject</span> <span class="powerShell__operator">-</span>ComputerName <span class="powerShell__variable">$ComputerName</span> <span class="powerShell__operator">-</span>Class Win32_ComputerSystem).Name <span class="powerShell__variable">$wmi</span> = <span class="powerShell__cmdlets">Get-WmiObject</span> <span class="powerShell__operator">-</span>ComputerName <span class="powerShell__variable">$ComputerName</span> <span class="powerShell__operator">-</span>Query <span class="powerShell__string">"SELECT * FROM Win32_GroupUser WHERE GroupComponent=`"</span>Win32_Group.Domain=<span class="powerShell__string">'$Hostname'</span>,Name=<span class="powerShell__string">'$GroupName'</span>`<span class="powerShell__string">""</span> <span class="powerShell__com"># Parse out the username from each result and append it to the array. </span> <span class="powerShell__keyword">if</span> (<span class="powerShell__variable">$wmi</span> <span class="powerShell__operator">-</span>ne <span class="powerShell__variable">$null</span>) { <span class="powerShell__keyword">foreach</span> (<span class="powerShell__variable">$item</span> <span class="powerShell__keyword">in</span> <span class="powerShell__variable">$wmi</span>) { <span class="powerShell__variable">$data</span> = <span class="powerShell__variable">$item</span>.PartComponent <span class="powerShell__operator">-</span>split <span class="powerShell__string">"\,"</span> <span class="powerShell__variable">$domain</span> = (<span class="powerShell__variable">$data</span>[0] <span class="powerShell__operator">-</span>split <span class="powerShell__string">"="</span>)[1] <span class="powerShell__variable">$name</span> = (<span class="powerShell__variable">$data</span>[1] <span class="powerShell__operator">-</span>split <span class="powerShell__string">"="</span>)[1] <span class="powerShell__variable">$arr</span> <span class="powerShell__operator">+</span>= (<span class="powerShell__string">"$domain\$name"</span>).Replace(<span class="powerShell__string">""</span><span class="powerShell__string">""</span>,<span class="powerShell__string">""</span>) [Array]::<span class="powerShell__alias">Sort</span>(<span class="powerShell__variable">$arr</span>) } } <span class="powerShell__variable">$hash</span> = @{ComputerName=<span class="powerShell__variable">$ComputerName</span>;Members=<span class="powerShell__variable">$arr</span>} <span class="powerShell__keyword">return</span> <span class="powerShell__variable">$hash</span> } <span class="powerShell__keyword">end</span>{} } |
Found Here
https://gallery.technet.microsoft.com/scriptcenter/List-local-group-members-c25dbcc4
Sometimes the standard event log filtering just isn’t enough, you need and more refined search criteria.
I find the best way to do this it Is to select the current event log category that you wish to search then filter current log.
This adds all the search criteria and selection criteria that you need. You can then begin to edit the query using XML tab. You will see something such as the following:
1 2 3 4 5 |
<QueryList> <Query Id="0" Path="System"> <Select Path="System">*</Select> </Query> </QueryList> |
In that list you will see a select statement between the two >< you will see an *. Here is where you enter your select query.
Individual queries are formed by Square parentheses below you will see some examples:
1 2 3 |
*[System[(EventID='4728')]] and *[EventData[Data[@Name='TargetUserName'] and (Data='Domain Admins') ]] |
The above example will give a list of events where a group change has been made to domain Admins.
* if you wish to target specific data viewing an event in the event log and check the XML data Will give you the information.
All Credit for this article goes HERE Thanks to Stephanie Kahlam
In previous versions of Dirsync (latest version 1.0.6862.0000) there was a nifty little shell that could be found in
1 2 3 |
C:\Program Files\Windows Azure Active Directory Sync\SYNCBUS\Synchronization Service\UIShell miisclient.exe |
I liked to create a shortcut on my desktop along with the ever so ambiguously named DirSync GUI, miisclient.exe. When I logged into my server I had quick access to launch DirSync GUI and also quick access to Force a Synchronization if required.
Today the DirSyncConfigShell.psc1 is no more. In order to enable the ability to “start” a quick synchronization you will now need to open a PS shell in Admin mode, enter “import-module DirSync” then run “start-onlinecoexistencesync”
If you need to check what version of DirSync you currently have installed, simply run the following PowerShell cmdlet:
By default DirSync (Windows Azure Active Directory Sync) will synchronize every 3 hours. This interval can be changed by editing the Microsoft.Online.DirSync.Scheduler.exe config file found in C:Program FilesWindows Azure Active Directory Sync
This window shows a sync interval of 5 mins after the config file has been edited
During setup of the Windows Azure Active Directory Sync tool Configuration Wizard you will be asked for two sets of credentials; Azure Office 365 Company Administrator and On-Premises AD domain administrator.
The account specified for Windows Azure is not required to be licensed in Office 365
This account should however, be configured with a NON expiring password as DirSync will cease to run if the password changes in Office 365. The password can be changed at the DirSync GUI should this occur but it is probably easier to set it to NON expiring and avoid service disruption to your Synchronization process.
To set a user to a non expiring password run the following PowerShell command:
If you need to change the password in DirSync GUI perform the following:
Open miisclient.exe
Click on Management Agents
Right click Windows Azure Active Directory Connector and choose properties
Click on Conncetivity then update the password