Posts

Showing posts from June, 2017

Using a Filter and WMI to Get Information When a Property Returned is a Base Object

Image
When using WMI, particularly querying win32_offlinefileitem, one of the properties returned is a System.ManagementBaseObject. In this example, I want to look for OfflineFile items that have "ChangeInfo", then inside it the "DirtyInfo" is True. To do that, use dot notation in your filter, like so: gwmi win32_offlinefilesitem -Filter "changeinfo.dirty = 'true'"

Unable to Update BIOS

This happened on a Dell Latitude E7440, but could easily happen to a number of models. Just ran into an issue where I was unable to update the BIOS for a Dell Latitude E7440. The file would run, and the machine would attempt to restart, but it would hang on the "Restarting" screen. The issue ended up being with the display driver. I uninstalled the Intel HD Video Card driver version 20.19.15.4531, rebooted and was able to install the BIOS update.

Fast Way to Get User Attributes from AD Without using Get-ADUser

Get-ADUser is slow and cumbersome to get information from, and required the AD module to be installed on the computer. Here is a faster way to get information from AD, without that PowerShell Module. $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = New-Object System.DirectoryServices.DirectoryEntry $objSearcher.Filter = "(&(objectCategory=User)(SamAccountname=$($loggedinUser)))" $objSearcher.SearchScope = "Subtree" $obj = $objSearcher.FindOne() #Use the attributes found in AD to get properties, with example used below $FullName =$obj.Properties["cn"] $JobTitle =$obj.Properties["description"] $StreetAddress =$obj.Properties["streetAddress"] $City =$obj.Properties["l"] $State =$obj.Properties["st"] $ZipCode =$obj.Properties["postalCode"] $PhoneNumber =$obj.Properties["homePhone"] $FaxNumber =$obj.Properties["facsimileTelephoneNumb...