Monday, October 31, 2016

Could not find this item when deleteing files



Had a file that needed to be deleted, but would not.  It was 0 bytes and Windows Explorer could not delete it.  The CMD prompt could not see it.  Tried the trick below and it worked.  Kudos to Tachy.




1) Open a Command Prompt.
2) Browse to the folder containing the buggy file.
3) Type 'dir /x' to obtain the 8.3 formatted filename.
4) Delete the file using the 8.3 filename, e.g. 'del NEWDOC~1.DOC'

Hope this information may spread and help other users with the same problem


REFERENCE: http://www.sevenforums.com/general-discussion/27924-could-not-find-item-when-deleting-files.html

Powershell" How to get AD group membership of a domain user



The best powershell command to get group membership of an individual is:


Get-ADPrincipalGroupMembership "username of user" | select name   | sort name


This command works well to just get a list of domain groups that the user is a member of.







Tuesday, October 18, 2016

Powershell commands for common network tools in Windows

Had to do a nslookup and ipconfig on a machine and wondered what were the powershell equivalent commands.  Here below are some:


nslookup = Resolve-DnsName
ipconfig  = Get-NetIpConfiguration  (Get-NetIPAddress,  Get-NetAdapter Wi-Fi)
ping        = Test-NetConnection
route       = Get-NetRoute
tracert     = Test-NetConnection -Traceroute
netstat     = Get-NetTCPConnection




for more detail see:
https://blogs.technet.microsoft.com/josebda/2015/04/18/windows-powershell-equivalents-for-common-networking-commands-ipconfig-ping-nslookup/



Monday, October 17, 2016

Diagnosing Active Directory

Here are some tips for checking the health of Active Directory:


Run dcdiag, netdiag and repadmin in verbose mode.
  DCDIAG /V /C /D /E /s:yourdcname > c:\dcdiag.log



  netdiag.exe /v > c:\netdiag.log (On each dc)

  repadmin.exe /showrepl * /verbose /all /intersite > c:\repl.txt



   A quick little dump repadmin /replsum > c:\replsum.txt
   ADReplStatus

   dnslint /ad /s “ip address of your dc”


**Note: Using the /E switch in dcdiag will run diagnostics against ALL dc’s
in the forest. If you have significant numbers of DC’s this test could
generate significant detail and take a long time. You also want to take
into account slow links to dc’s will also add to the testing time.
When complete search for fail, error and warning messages.

 DCDiag explanation
http://blogs.technet.com/b/askds/archive/2011/03/22/what-does-dcdiag-actually-do.aspx


Description and download for dnslint
http://support.microsoft.com/kb/321045


ADReplStatus Download and Description
http://www.microsoft.com/en-us/download/details.aspx?id=30005
http://windowsitpro.com/active-directory/active-directory-replication-status-tool-ad-utility-weve-all-been-waiting-almost


(Reference: Paul Bergson - https://dirteam.com/paul/2009/01/26/troubleshooting-active-directory-issues/)