[RunReloaded09] Que hay de Nuevo Windows Server 2008 R2?
November 28th, 2009
We had a great show this Tuesday, the first session after the keynote was about Windows Server 2008 R2 and we had lot of stuff to show and to share with the audience, you can get the presentation here,
I promise I was going to drop the powershell scripts here, and here they are,
Remote Powershell and Best Practices Analyzer Example
- #get services
Get-Service | where {$_.status -eq "Running"} - #get services remoto
Enter-PSSession TN-DOM2
Get-Service | where {$_.status -eq "Running"}
Exit-PSSession - #Listar estado de los tests BPA
Import-Module ServerManager
Import-Module BestPractices
Get-Command *BPA*
#Get-WindowsFeature | Where {$_.BestPracticesModelId -ne $null} | Select BestPracticesModelId
Invoke-BpaModel Microsoft/Windows/WebServer
Get-BpaResult -BestPracticesModelId Microsoft/Windows/WebServer | Select * | Out-GridView
TechNET Migration Portal CMDLets
TechNET did a great work to ease migration experience to Windows 2008 R2, go and take a look to the TechNET Migration Portal. During the demostration we migrated a File Server role from a Windows 2008 server to a Windows 2008 R2 server.
- #En ambos servers
Add-PSSnapin Microsoft.Windows.ServerManager.Migration - #Primero: Desde server origen
Receive-SmigServerData - #2do: Desde Server destino
Send-SmigServerData -ComputerName <DestinationServer> -SourcePath d:\users -DestinationPath d:\shares\users -Recurse -Include All -Force
Active Directory Recycle Bin
The credits for the “Enable AD Recycle Bin” part are for Leandro Amore, I took the script from his blog, I know he wont be mad about it :).
-
#Enable AD recycle bin
import-module activedirectory$forest=Get-ADForest -Current loggedonuser
Set-ADForestMode -Identity $forest.name -ForestMode ‘windows2008r2forest’ -confirm:$false
Enable-ADOptionalFeature -Identity ‘Recycle Bin Feature’ -Scope forest -Target $forest.name -confirm:$false
Get-ADOptionalFeature -filter ‘name -eq "Recycle Bin Feature"’
-
#Mostrar computadoras en el recycle bin
Get-ADObject -filter ‘isdeleted -eq $true -and name -ne "Deleted Objects"’ -includeDeletedObjects -property * | Select samAccountName,displayName,lastKnownParent | Out-GridView -
#Restore de computadora una ves ubicada
Get-ADObject -filter ’samAccountName -eq "TN-SCO1$"’ -includeDeletedObjects | Restore-ADObject
Active Directory Managed Accounts
Finally, we configured a service to run under the identity of a Managed Service account a cool new feature of AD DS on Windows Server 2008 R2.
-
#registrar MSA
Import-Module ActiveDirectoryNew-ADServiceAccount -Name wwwTN-SCO1 -Enabled $true
Add-ADComputerServiceAccount -Identity TN-SCO1 -ServiceAccount wwwTN-SCO1
-
#instalar MSA
Install-ADServiceAccount -Identity wwwTN-SCO1
Hope you enjoy it!

January 12th, 2010 at 12:11 am
Are you doing anything professional with your writings? You Should. Thanks.