« Réactiver license office » : différence entre les versions

De Wiki du sac
(Page créée avec « réactivé licence office avec: cd "C:\Program Files\Microsoft Office\Office16" cscript ospp.vbs /act ==Script powershell pour reactiver à distance toutes les versions d'office: # mettre le bon numero d'ordi cls $RemoteComputer = "222144pt" $SessionArgs = @{ ComputerName = $RemoteComputer #Credential = Get-Credential SessionOption = New-CimSessionOption -Protocol Dcom } $MethodArgs = @{... »)
 
Aucun résumé des modifications
 
Ligne 44 : Ligne 44 :
  Invoke-CimMethod @MethodArgs  
  Invoke-CimMethod @MethodArgs  
  Invoke-Command -ComputerName $RemoteComputer -ScriptBlock{  
  Invoke-Command -ComputerName $RemoteComputer -ScriptBlock{  
 
   $allospp = @("C:\Program Files\Microsoft Office", "C:\Program Files (x86)\Microsoft Office") | %{ Get-  
   $allospp = @("C:\Program Files\Microsoft Office", "C:\Program Files (x86)\Microsoft Office") | %{ Get-  
  ChildItem  $_ -recurse | Where-Object {$_.fullname -like "*ospp.vbs"} | Select-Object -expandproperty fullname
  ChildItem  $_ -recurse | Where-Object {$_.fullname -like "*ospp.vbs"} | Select-Object -expandproperty fullname

Version actuelle datée du 10 mai 2023 à 17:54

réactivé licence office avec:


cd "C:\Program Files\Microsoft Office\Office16"


cscript ospp.vbs /act 


==Script powershell pour reactiver à distance toutes les versions d'office:


  1. mettre le bon numero d'ordi
cls   

$RemoteComputer  = "222144pt" 

$SessionArgs = @{ 

    ComputerName = $RemoteComputer  

    #Credential    = Get-Credential 

    SessionOption = New-CimSessionOption -Protocol Dcom 

} 

$MethodArgs = @{ 

     ClassName     = 'Win32_Process' 
     MethodName    = 'Create' 

    CimSession    = New-CimSession @SessionArgs 

    Arguments     = @{ 

        CommandLine = "powershell Start-Process powershell -ArgumentList 'Enable-PSRemoting -Force'" 

    } 
} 

Invoke-CimMethod @MethodArgs 
Invoke-Command -ComputerName $RemoteComputer -ScriptBlock{ 

  $allospp = @("C:\Program Files\Microsoft Office", "C:\Program Files (x86)\Microsoft Office") | %{ Get- 
ChildItem  $_ -recurse | Where-Object {$_.fullname -like "*ospp.vbs"} | Select-Object -expandproperty fullname
} 
  foreach ($thisospp in $allospp) 
  { 

       cscript $thisospp /act 
  } 
}