Affichage des articles dont le libellé est Windows. Afficher tous les articles
Affichage des articles dont le libellé est Windows. Afficher tous les articles

dimanche 16 juin 2013

[WMI] Désactiver un service

IN : Fichier .txt qui contient un nom de machine par ligne ( path du fichier ici : c:\x.txt)

ACTION : Stop & Disable une service sur un server distant
Le credential sont donnés via la variable $cred
$cred = get-credential

RETURN : Retourne un hashtable avec le resultat.

In this script I want to disable the service "V-Locity" on the machine name list in c:\x.txt :
Cat c:\x.txt | % 
$disabled = (Get-WmiObject win32_service -ComputerName $_ -Credential $cred | ? { $_.name -match "V-locity"}).InvokeMethod("ChangeStartMode","Disabled")
$stop = (Get-WmiObject win32_service -ComputerName $_ -Credential $cred | ? { $_.name -match "V-locity"}).stopservice()
$object = new-object psobject -property @{
Name = $_
Disabled = $disabled
stop = $stop
}

$object
}

mercredi 1 février 2012

Acceder au drive C$ en Windows 7


Par default dans Windows 7 il n'est pas possible d'acceder à vos disque dur en tapant \\\c$

Pour regler ce probleme, il faut créer cette clé registre :

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

Create a DWORD : LocalAccountTokenFilterPolicy 

Set the value to "1"

Tested and approved on a Windows 7 Pro SP1

Source