Microsoft Product Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 25 October 2012

Find Old Computers in AD

Posted on 15:36 by Unknown
For Windows 2003/2008
(Must be 2003 Native domain or newer)
In a Command Prompt window type:
dsquery computer -inactive <num>
Where <num> is the minimum number of weeks the device has been inactive for. Advice seems to be to use at least 2, as anything less than that is not fully reliable.

For Windows 2008 R2+
In a PowerShell  window type:
$time=Read-host "Enter a date in format mm/dd/yyyy"
then
Get-ADComputer -Filter * | Get-ADObject -Properties lastlogontimestamp | where {(([DateTime]::FromFileTime($_.lastlogontimestamp) - ([system.datetime]$time)).totaldays) -lt 0 } | 

NOTE: This post needs some work to get it exactly the way I would use it, but the necessary commands in here should be roughly correct.

For more detail or a better example (of which this is basically a cut and paste at the moment), see reference site below.

References:
http://blog.mattvogt.net/powershell-last-logon-timestamp-for-single-ho 
Read More
Posted in active directory, AD, dsquery, old computer accounts, old computers, powershell | No comments

Tuesday, 9 October 2012

Reset Offline Files Cache in Windows 7

Posted on 20:55 by Unknown
To reset the offline files cache in Windows 7

  1. Create a registry file called resetcache.reg file with the following contents:

    Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\CSC\Parameters] "FormatDatabase"=dword:00000001
  2. Double click the file and it should merge with registry. Alternatively, use command line:
    E.g. regedit.exe /s resetcache.reg
  3. Reboot the PC

Reference:
http://www.networknet.nl/apps/wp/archives/1093
Read More
Posted in cache, offline files, registry | No comments

Find the Desktop

Posted on 18:28 by Unknown
It can be REALLY hard to access the desktop using scripts, especially batch scripts, if it has been moved from the default location of C:\Users\%username%, or even worse if it has been moved out of the %userprofile% location by the way of Folder Redirection.

As batch files cannot find this location, and I do not want to start learning VB script, I want a Powershell method I can use to find it.

This is the method I found:

$desktop = [Environment]::GetFolderPath("Desktop")

The $desktop variable now contains the location to the currently logged-in user's desktop. To view this path simply type

write-host $desktop

Happy day!

Reference:
The comment on the post at http://stackoverflow.com/questions/11349885/get-currently-logged-in-users-with-powershell-to-add-shortcut-to-desktop

:-)
Read More
Posted in desktop, folder redirection, powershell | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • Connecting Windows 8 to SBS 2008/2011 RWW
    If you are using Windows 8 and cannot connect to computers via  to SBS 2008 or 2011 Remote Web Workplace, the following may help. It is lik...
  • SharePoint Updates Cause Site to Fail
    Config Wizard Access Denied http://blogs.catapultsystems.com/mpoole/archive/2011/02/12/sharepoint-2007-config-wizard-access-denied.aspx Cann...
  • Symantec Endpoint Protection Manager 11 - Unable to Communicate with Reporting Component
    If you are on a 32-bit OS, skip the next step. If you are on a 64-bit OS, first go to 32-bit ODBC Control Panel. To do this do the following...
  • Symantec Endpoint Protection Has Detected Pending Changes
    When installing Symantec Endpoint Protection, sometimes you will see an error message that "Symantec Endpoint Protection has detected t...
  • Reset Offline Files Cache in Windows 7
    To reset the offline files cache in Windows 7 Create a registry file called resetcache.reg file with the following contents: Windows Registr...
  • Find the Desktop
    It can be REALLY hard to access the desktop using scripts, especially batch scripts, if it has been moved from the default location of C:\Us...
  • Connecting to Windows Internal Database MICROSOFT##SSEE
    This is often useful when administering Sharepoint services on a Windows SBS 2008 system: http://www.networkinghowtos.com/howto/connecting-w...
  • DirectAccess Routing Considerations
    Default gateway should be configured on the server's external interface. So static routes will need to be configured on the internal int...
  • Configure Windows 7 Libraries via Group Policy
    A great article on this here: http://kevinjmorse.ca/articles/configuring-windows-7-libraries-using-group-policy-preferences Thanks guys!
  • Enable Legacy Boot Mode on Windows 8 Pre-Installed Device
    Apparently Microsoft requires OEM suppliers of Windows 8 systems to set the BIOS (actually UFEI now) to Secure Boot by default. This and ano...

Categories

  • access
  • acl
  • active directory
  • Active Directory Federation Services
  • AD
  • add mailbox
  • ADFS
  • ADFS 2.0
  • antivirus
  • Apple
  • automatic configuration
  • BIOS
  • black and white
  • black screen
  • browser
  • bulk import
  • bulk user import
  • cache
  • check
  • Cisco
  • click to run
  • click-to-run
  • clipboard
  • colour
  • command line
  • Compatibility Support Module
  • computer
  • configuration wizard
  • control panel
  • copy
  • CSM
  • data migration
  • database
  • delete
  • desktop
  • detect
  • DirectAccess
  • domain
  • dsquery
  • duplex
  • edition
  • email address
  • embedded database
  • endpoint protection
  • endpoint protection manager
  • error
  • exchange
  • exchange 2003
  • exchange 2007
  • exchange 2010
  • file
  • firewall
  • folder redirection
  • force
  • GASFO
  • Google Apps
  • Google Apps Sync for Outlook
  • GPO
  • group policy
  • inline editor
  • installation
  • IPv6
  • Java
  • java update
  • join domain
  • ldf
  • Legacy Boot
  • libraries
  • library
  • log file
  • Lync
  • Lync Server
  • Lync Server 2010
  • Lync Server 2013
  • Mac
  • mail relay
  • mailbox
  • mailbox creation
  • mailbox setup
  • mailbox statistics
  • Microsoft
  • microsoft##SSEE
  • minimised
  • minimized
  • multicast
  • netdom
  • network
  • Network and Sharing Centre
  • new mailbox
  • new window
  • NIC
  • Office 2013
  • Office 365
  • offline files
  • old computer accounts
  • old computers
  • old user accounts
  • Outlook
  • Outlook 2013
  • pac
  • paste
  • pop-out
  • powershell
  • prerequisites
  • print
  • Print Defaults
  • Print Preferences
  • print server
  • print settings
  • printer
  • Private Network
  • proxy
  • Public Network
  • rdp
  • re-appearing
  • reappearing
  • recover
  • recovery
  • registry
  • remote
  • remote connection
  • remote management
  • Remote Web Workplace
  • restart
  • restore
  • restrict
  • routing
  • RWW
  • sbs
  • sbs 2008
  • sbs 2011
  • scripts
  • Secure Boot
  • SEP
  • SEPM
  • service
  • sharepoint
  • shrink database
  • simple backup
  • site-to-site
  • slow
  • SQL
  • SQL server
  • support
  • Symantec
  • Symantec Endpoint Protection Manager
  • timeout
  • trust relationship
  • UEFI
  • USB
  • user
  • user data
  • version
  • virtual labs
  • VPN
  • wds
  • Windows 2003 domain
  • Windows 2008 R2
  • Windows 7
  • Windows 8
  • windows deployment services
  • windows internal database
  • windows update
  • WMI
  • WSUS

Blog Archive

  • ►  2013 (35)
    • ►  November (3)
    • ►  October (1)
    • ►  September (3)
    • ►  August (3)
    • ►  July (2)
    • ►  June (3)
    • ►  May (1)
    • ►  April (6)
    • ►  March (1)
    • ►  February (10)
    • ►  January (2)
  • ▼  2012 (15)
    • ►  December (4)
    • ►  November (3)
    • ▼  October (3)
      • Find Old Computers in AD
      • Reset Offline Files Cache in Windows 7
      • Find the Desktop
    • ►  September (3)
    • ►  May (2)
Powered by Blogger.

About Me

Unknown
View my complete profile