Quick Fix: Windows 7 unable to join domain…

Source: http://titlerequired.com/2011/03/23/quick-fix-windows-7-unable-to-join-domain/

I was looking at a clients laptop today, brand new Toshiba running Win 7 Pro.

I attempted to join it to the domain using the traditional, system properties / computer name tab method, but i was given a message that unfortunatley i didnt note down, but basically read…

Unable to join the domain, unable to start the service, service may be disabled..

Imediatley i thought of the netlogon service, and i went to the services.msc console and tried to start the netlogon service. It failed, with the message..

Could not start service, service may be disabled…

So, i thought, this is quite bad because the DNS Suffix of the machine has changed, and i dont want to reboot because i could be stuck half way through the join leaving the machine unstable, or worse it wont boot up or let me logon, and working on this remotley would make that a real pain!

So of course i tried again a few times, i then checked UAC settings which were not at the default, but i put them back to default anyway. No change.

I then decided to try and force it back into a workgroup to get out of any potential split issues, and that did succeed,

Welcome to the TEST workgroup!

I then tried to rejoin the domain, this time Success!

Wish i could put my finger on what went wrong, but laptop is now in the domain!

Powershell Script: Delete x days old files from a folder. Days and file types can be changed

## The Script is written by Ali – Spice-IT-up (Spiceworks). It should be used with caution and at your own risk
## ##  I do not take any responsibility. If you accidently tell the script to delete the system files, Contact me so I accidently hit you on the head
## ##  Delete 2 days old files with the extension .log. You can change the number of days and the file type below
## To schedule this script, you will have to run this Script through a batch file with the command: powershell -command “& ‘full:\path\DelOldFiles.ps1’ ”
## If this script help you, please leave some comments and give me some points. I am fairly new at Spiceworks. Thanks

Function GetOldFile
$Days = “2” #You can change the number of days here
$TargetFolder = “G:\PSH” #Enter full Target folder path
if (Test-Path $TargetFolder)
$Now = Get-Date
$LastWrite = $Now.AddDays(-$days)
$Files = get-childitem $TargetFolder -include *.log -recurse |Where {$_.LastWriteTime -le “$LastWrite”} #Change the file type to different one if needed (*.log)
foreach ($File in $Files)
{write-host “Deleting file $File” -foregroundcolor “Red”; Remove-Item $File | out-null}
{Write-Host “The folder $TargetFolder doesn’t exist! Check the folder path!” -foregroundcolor “red”}