mercoledì 21 agosto 2013

WSUS troubleshooting

This artilcle is in english to be useful to more people.

I've spent some time to setup wsus on my environment and other time to maintain that and to approve the updates but oftent I saw client that are not loggin on the wsus server. 
Here you can find some useful workaround:

Situation: - There's a group policy that sets WSUS on the clients (not mandatory, you can use also a script see: http://msmvps.com/blogs/athif/pages/Manually-Configure-WUA.aspx)
- My wsus have a DNS alias that points on the correct server (just for future upgrades, this avoid change group policy or settings on the clients)

To be sure that your client is receiving properly updates:
1. check if your client receive the correct policy, with group policy result wizard or directly on the client looking the content of this registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate
you should see this two values:

"WUServer"="http://YOUR-WSUS-SERVER"
"WUStatusServer"="
http://YOUR-WSUS-SERVER"


 2. Check if dns resolution works correctly:
nslookup YOUR-WSUS-SERVER<.name.local> 

3. Chek with internet explorer if you can access the wsus website with the address on the key in point 1


At this point all should work and if you use wuauclt /detectnow after some time you should see the client registered on wsus server and probably some updates needed.

If the client still not connect to the server use the WSUS client diagnostic tool: http://download.microsoft.com/download/9/7/6/976d1084-d2fd-45a1-8c27-a467c768d8ef/WSUS%20Client%20Diagnostic%20Tool.EXE
(see other tools here: http://technet.microsoft.com/en-us/windowsserver/bb466192.aspx)

Run the client in a command window and see if all the test are: PASSED
If not look at the Winhttp proxy setting section and see if there's a proxy defined here.

In my case was as: (you can read) "proxy:" and then "avoid proxy for 192.168.1.25"

This lines was the ones that avoid access to WSUS, the local system account is using the string as a proxy and the server is not in the "avoid proxy list".

use the command proxycfg  to see which is the configuration and eventually use: proxycfg -d to go diretct or proxycfg -p to set parameters correctly.

This worked for me like a charm.


martedì 16 luglio 2013

VMWare patch install

Last patch for VMWare 5.1 is 
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2051208
 
and the command line to install it is: 
 esxcli software vib install --depot="/vmfs/volumes/ds-r1-l0/esx51patch/ESXi510-201305001.zip"

VMWare disk cloning via command line

The free version of VMWare as strange could appears is a very good version also in production environments, it lacks obviously of various function, one of them is the ability to create template or copy virtual machines, which are very useful.

The solution is to create a vm as a template, with a name like tmpl.w2k8r2 to distinguish from production one, then create a new virtual machine with the desired hw resources but without disks.
Then clone the disk with this simple command, it is also possible to create a mini script:

vmkfstools --clonevirtualdisk tmpl.w2k8R2/tmpl.w2k8R2.vmdk [vmfolder]/[newvmdisk].vmdk


lunedì 1 luglio 2013

Simple Bulk User Creation in AD Using powershell

After some testing I found the easiest way to bulk create users in AD using: powershell new cmdlet and some DSQUERY & DSMOD commands.

First of all create an excel file with this header columns: 
Name,Display Name,Description,sAMAccountName,given Name,Surname,Title,physicalDeliveryOfficeName,
OfficePhone,givenName,displayName,Company,
department,userPrincipalName,Path,
EmailAddress,City,State,Enabled,Country

Fill the excel file with your users detail. 

Notes:
userPrincipalname: usually I put name.surname@domain.local
State: is the "state/province" field in AD Gui
Country: is the combo box Country/Region, this field must be in form "US" for usa or "IT"for Italy.
Path: is the Distinguisced Name of the Organizational Unit inside your forest so must be in form "OU=my users, DC=test,DC=local"



The colums are not all mandatory but this list fill almost all the useful fileds for users.


Then export the file as CSV, if your operating system is not english you should remember to change the field separator to a comma. In my italian version of excel the field separator is: ";" or use the -delimiter ";" switch on the command line.
When you export from excel correct the " sign in the csv should be in the form: 
"""

Done that connect to your w2008 DC and  execute the "Active Directory Module for Windows PowerShell" from Administrative tools or a normal power shell console but remember to import module ActiveDirectory

Then if your CSV file was done correctly run: 
Import-Module ActiveDirectory
import-CSV | New-ADUser 

You should see after a refresh the new created users in the path you selected. I suggest to use a temporary OU set adhoc for that (see below)

Unfortunately the field AccountPassword do not set corrctly the password so the easiest way to change is to run: 
DSQUERY user "OU=MyNewUsers,OU=MyCompanyAccount,DC=mydomain,DC=local" | DSMOD user -pwd

That's IT!

martedì 4 giugno 2013

Windows XP missing Device List

Oggi mi è capitata una cosa strana, pensavo di non uscirne e di dover reinstallare il sistema operativo-

Ho aggiunto una scheda video ad un pc, niente di tale in se'. Se non fosse stato per il fatto che il pc in questione non ne voleva sapere e che il triver falliva l'installazione.


Dopo poco scopro che l'elenco dei device nell'hw manager è vuoto!

Nessun messaggio negli eventi, nessun segnale di malfunzionamento.... La causa ? nel registro di configurazione mancavano i permessi alla chiave 
HKLM\System\CurrentControlSet\Enum
Occorre assegnare a System "Full Control" e a Everyone "Read Only"


lunedì 6 maggio 2013

Configurazione IIS 7 come proxy

Prima occorre installare l'application Request Routing:
http://www.iis.net/learn/extensions/installing-application-request-routing-%28arr%29/install-application-request-routing

Poi seguire gli step qui: 
http://www.iis.net/learn/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing

giovedì 11 aprile 2013

Utili strumenti per la gestione delle ACL in ambiente NTFS

Fino a Windows Vista e 7 lo strumento canonico era CACLS ora esiste ICACLS che offre delle funzionalità di verifica e esportazione utili per la migrazione di filesystem ma probabilmente ancor più utili per il mantenimento delle permission in ambienti dove ci sono più amministratori.

Per la migrazione preferisco sempre Robocoy con il parametro /SEC per la copia delle security NTFS.