Archive for the ‘Windows’ Category

all acounts:

Import-Module ActiveDirectory
Get-ADUser -Filter * -SearchBase 'OU=XYZ,DC=subdomain,DC=domain,DC=com' -prop mail | ForEach-Object {
Set-ADUser -Identity $_ -EmailAddress ($_.mail -replace "@old-mail-domain.com","@new-mail-domain.com") -Verbose
}

only enabled accounts:

Import-Module ActiveDirectory
Get-ADUser -Filter 'enabled -eq $true' -SearchBase 'OU=XYZ,DC=subdomain,DC=domain,DC=com' -prop mail | ForEach-Object {
Set-ADUser -Identity $_ -EmailAddress ($_.mail -replace "@old-mail-domain.com","@new-mail-domain.com") -Verbose
}

cmd (admin rights!)

certreq -submit -attrib “CertificateTemplate:Computer-IKEv2-VPN-without-AD” VPN3.CSR VPN3.CER

Computer-IKEv2-VPN-without-AD – name of Template in CA
VPN3.CSR – CSR generated in offline server
VPN3.CER – CERT file generated after signing by CA


Check number of CAL’s:

Get-WmiObject Win32_TSLicenseKeyPack|Select KeyPackId, ProductVersion, TotalLicenses, TypeAndModel|Format-List

Reduce number of CAL licences:

Invoke-WmiMethod -Class Win32_TSLicenseKeyPack -Name RemoveLicensesWithIdCount -ArgumentList <KeyPackId>,<NumberOfCALsToRemove>

example:
if the KeyPackId is 6
you want to reduce the license count by 20,
you would enter :

Invoke-WmiMethod -Class Win32_TSLicenseKeyPack -Name RemoveLicensesWithIdCount -ArgumentList 6,20

Verify:

Get-WmiObject Win32_TSLicenseKeyPack|Select KeyPackId, ProductVersion, TotalLicenses, TypeAndModel|Format-List

Case 1:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\SkipRearm
0 -> 1

Case 2:

HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState 
-> 7
HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\CleanupState
-> 2

Case 3:

msdtc -uninstall
msdtc -install
Then sysprep machine.

Monitor System Center Data Protection Manager by Zabbix:

  1. Install zabbix agent on Windows (make it reports to server)
  2. Create PowerShell script that reports SCDPM status:
import-module DataProtectionManager
$dpmserver = connect-dpmserver (&hostname) -WarningAction:SilentlyContinue
$dpmserver.alertcontroller.refreshalerts()
#Wait-Event -timeout 15
$alerts = @($dpmserver.AlertController.ActiveAlerts.Values)
$warnings = $alerts | where-object {$_.Severity -eq “Warning”} | Measure-Object | select count
$errors = $alerts | where-object {$_.Severity -like “Error”} | Measure-Object | select count
if ($errors.count -ne 0) {
$status = “Error – One or more error conditions exist and backups need to be checked.”
$returnCode = 2
}
elseif ($warnings.count -ne 0) {
$status = “Warning – One or more warning conditions exist. Log onto DPM server to check the status.”
$returnCode = 1
}
else {
$status = “OK”
$returnCode = 0
}
write-host $status
exit $returnCode

source: https://social.technet.microsoft.com/Forums/en-US/02a7e440-7501-4fd7-9052-ee0850995b09/remote-dpm-monitoring-possibilities?forum=dataprotectionmanager

 

3. Create ITEM on Zabbix Server:

TYPE:
Zabbix Agent (Active)

KEY:
system.run[“C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File C:\zabbix_check.ps1”,]

 

4. On Zabbix Agent config add timeout:

#timeout for powershell script
Timeout=30

source:
VMware vCenter Server 5.5.0 (Windows 2012R2, MSSQL 2012 Express), 12GB RAM

target:
VMware vCenter 6.0 U3 Appliance (Linux, PostgreSQL), 16 GB RAM

 

Error:

  • Firstboot script execution error
  • This is an unrecoverable error, please retry install. If you run into this error again, please collect a support bundle and open a support request
  • /var/log/firstboot/vpostgres-firstboot.py_16503_stderr.log
  • install.ciscommon.internal.error
  • This vCenter Server has extensions registered that cannot be upgraded to or may not work with the new vCenter Server. Extensions: VR Management (by VMware, Inc.) on http://vcenter:80/|https://appliancevr:8043 VMware vSphere Update Manager Extension on https://vcenter:8084/vci/sdk vCenter Operations Manager (by VMware, Inc.) on https://new_vcenter/vcops-vsphere/viClientConfig.xml

 

Znalezione obrazy dla zapytania vcenter fastboot failed

 

on logs:

csd.txt :
[2018-05-23 15:28:44] [INFO] Web Socket Server [50100] Terminated With no error code
[2018-05-23 15:28:44] [INFO] CSD Server Exited.
[2018-05-23 15:28:44] [INFO] Lookup: stop called…
[2018-05-23 15:28:44] [INFO] Lifetime: join…
[2018-05-23 15:28:47] [INFO] Lifetime Timer stopped.
[2018-05-23 15:28:47] [INFO] Lifetime: Exited.
[2018-05-23 15:28:47] [INFO] Lookup: Exited.
[2018-05-23 15:28:47] [INFO] ~MigrationApi
[2018-05-23 15:28:47] [INFO] Process exiting.
vcsa_0001.txt:
2018-05-23 14:47:23.065316 CIP Service [VCSA INFO] nfc.vmGetFile: {“type”:”result”,”statusCode”:”PROCESS_STATUS”,”sessionId”:”VUWL-RKh1-ot5F-ysjh”,”requestId”:”5509″,”requestComponentId”:”fileTransfer”,”requestObjectId”:”cQk5-Fj2d-VuiB-e1PL”,”result”:”{\n \”status\”: \”error\”, \n \”info\”: [], \n \”question\”: null, \n \”progress_message\”: {\n \”args\”: [\n \”VMware Postgres\”\n ], \n \”id\”: \”install.ciscommon.component.starting\”, \n \”localized\”: \”Starting VMware Postgres…\”, \n \”translatable\”: \”Starting %(0)s…\”\n }, \n \”warning\”: [], \n \”error\”: {\n \”resolution\”: {\n \”id\”: \”install.default.failure.resolution\”, \n \”localized\”: \”This is an unrecoverable error, please retry install. If you run into this error again, please collect a support bundle and open a support request.\“, \n \”translatable\”: \”This is an unrecoverable error, please retry install. If you run into this error again, please collect a support bundle and open a support request.\”\n }, \n \”detail\”: [\n {\n \”args\”: [\n \”see /var/log/firstboot/vpostgres-firstboot.py_16503_stderr.log\”\n ], \n \”id\”: \”install.ciscommon.internal.error\”, \n \”localized\”: \”Encountered an internal error.\\n\\nsee /var/log/firstboot/vpostgres-firstboot.py_16503_stderr.log\“, \n \”translatable\”: \”Encountered an internal error.\\n\\n%(0)s\”\n }\n ], \n \”componentKey\”: \”vpostgres\”, \n \”problemId\”: null\n }, \n \”progress\”: 48\n}”,”isFinal”:”true”}
2018-05-23 14:47:23.068319 Progress Page: [VCSA ERROR] – First Boot error
2018-05-23 14:47:28.784075 CIP Service [VCSA INFO] nfc.vmGetSupportBundle: {“type”:”result”,”statusCode”:”PROCESS_STATUS”,”sessionId”:”VUWL-RKh1-ot5F-ysjh”,”requestId”:”5515″,”requestComponentId”:”fileTransfer”,”requestObjectId”:”D2ER-tpuj-51BF-Unl0″,”result”:””,”isFinal”:”false”,”item”:[“{\”error\”:\”vim.fault.FileNotFound\”}”]}
2018-05-23 14:47:30.187195 CIP Service [VCSA INFO] nfc.vmGetSupportBundle: {“type”:”result”,”statusCode”:”PROCESS_STATUS”,”sessionId”:”VUWL-RKh1-ot5F-ysjh”,”requestId”:”5515″,”requestComponentId”:”fileTransfer”,”requestObjectId”:”D2ER-tpuj-51BF-Unl0″,”result”:””,”isFinal”:”true”}
2018-05-23 14:47:30.191199 Progress Page: [VCSA ERROR] Error in downloading support bundle
2018-05-23 14:48:10.911286 CIP Service [VCSA INFO] nfc.vmGetSupportBundle: {“type”:”result”,”statusCode”:”PROCESS_STATUS”,”sessionId”:”VUWL-RKh1-ot5F-ysjh”,”requestId”:”5521″,”requestComponentId”:”fileTransfer”,”requestObjectId”:”fNmx-IuPq-78cR-k5BZ”,”result”:””,”isFinal”:”false”,”item”:[“{\”error\”:\”vim.fault.FileNotFound\”}”]}
2018-05-23 14:48:12.316936 CIP Service [VCSA INFO] nfc.vmGetSupportBundle: {“type”:”result”,”statusCode”:”PROCESS_STATUS”,”sessionId”:”VUWL-RKh1-ot5F-ysjh”,”requestId”:”5521″,”requestComponentId”:”fileTransfer”,”requestObjectId”:”fNmx-IuPq-78cR-k5BZ”,”result”:””,”isFinal”:”true”}
2018-05-23 14:48:12.320941 Progress Page: [VCSA ERROR] Error in downloading support bundle
2018-05-23 14:48:53.037021 CIP Service [VCSA INFO] nfc.vmGetSupportBundle: {“type”:”result”,”statusCode”:”PROCESS_STATUS”,”sessionId”:”VUWL-RKh1-ot5F-ysjh”,”requestId”:”5527″,”requestComponentId”:”fileTransfer”,”requestObjectId”:”u4fv-YEyW-ODJE-aHO5″,”result”:””,”isFinal”:”false”,”item”:[“{\”error\”:\”vim.fault.FileNotFound\”}”]}
2018-05-23 14:48:54.440281 CIP Service [VCSA INFO] nfc.vmGetSupportBundle: {“type”:”result”,”statusCode”:”PROCESS_STATUS”,”sessionId”:”VUWL-RKh1-ot5F-ysjh”,”requestId”:”5527″,”requestComponentId”:”fileTransfer”,”requestObjectId”:”u4fv-YEyW-ODJE-aHO5″,”result”:””,”isFinal”:”true”}
2018-05-23 14:48:54.443297 Progress Page: [VCSA ERROR] Error in downloading support bundle
2018-05-23 14:49:38.771027 CIP Service [VCSA INFO] nfc.vmGetSupportBundle: {“type”:”result”,”statusCode”:”PROCESS_STATUS”,”sessionId”:”VUWL-RKh1-ot5F-ysjh”,”requestId”:”5534″,”requestComponentId”:”fileTransfer”,”requestObjectId”:”tfqA-CRMH-XOIh-bOXA”,”result”:””,”isFinal”:”false”,”item”:[“{\”data\”:\”\”}”]}
2018-05-23 14:49:39.573271 CIP Service [VCSA INFO] nfc.vmGetSupportBundle: {“type”:”result”,”statusCode”:”PROCESS_STATUS”,”sessionId”:”VUWL-RKh1-ot5F-ysjh”,”requestId”:”5534″,”requestComponentId”:”fileTransfer”,”requestObjectId”:”tfqA-CRMH-XOIh-bOXA”,”result”:””,”isFinal”:”true”}
2018-05-23 14:49:39.577275 Progress Page: [USER INFO] Support bundle created successfully – {“type”:”result”,”statusCode”:”PROCESS_STATUS”,”sessionId”:”VUWL-RKh1-ot5F-ysjh”,”requestId”:”5534″,”requestComponentId”:”fileTransfer”,”requestObjectId”:”tfqA-CRMH-XOIh-bOXA”,”result”:””,”isFinal”:”true”}
2018-05-23 15:14:49.825467 Progress Footer: Closing the installation wizard

 

what to check:

  1. Check DNS, forward and reverse resolution
  2. Check NTP server, try to sync time
  3. Plug-in not compatible is better to unregister/uninstall:  how to.
    I uninstalled: Update Manager, Operations Manager, UCS Plugin, VR Plugin
  4. In our environment Replication Appliance was incompatible with new version of vCenter. I stopped all replication jobs, unregistered Appliance (how to). Stopped VR Appliance.
  5. Check the database size…

 

Resolution:

In my situation, 8GB database (MSSQL) on Win2012R2 with 12GB RAM (small vCenter, 1000VM), was migrated to the same, small vCenter on Linux (1000 VM), with 16 GB RAM.

… it was to small.
I modified: vCenter Server to 32GB RAM,
on migration step I choose Large vCenter (32GB RAM) to create large vCenter Appliance

Success :)

ps. after this, I downsized RAM to 16GB :)

 

VMware Appliance size

 

RESULT:

VMware Migration result

 

 

SkipRearm – use Windows without activating

When evaluation period is expired, and you cannot rearm OS, then change registry key:

 

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\SoftwareProtectionPlatform\

 

change value of SkipRearm to 1

 

tested on Win2012R2

Problem:

Type: Consistency check Status: Failed Description: DPM cannot continue protection for VMware <vm_name> on <vCenter_server/ESX host IP>  (ID 30184) More information End time: 2018-03-12 23:48:37 Start time: 2018-03-12 23:48:37 Time elapsed: 00:00:00 Data transferred: 0 MB Cluster node – Source details: <vm_name> Protection group: Protection Group 1 Items scanned: 0 Items fixed: 0

 

Resolution 1:

Problem with VM *.vmx file.

  • Delete vmx and recreate VM
    or
  • create new VM and bind hdd from old VM.

 

Resolution 2:

  • check if there is not snapshot on VM! :)

System Center Data Protection 2016

SC-SQL – IP: 10.45.1.200
SC-DPM – IP: 10.45.1.201

Problem:

Installing DPM and connecting it to remote SQL, I’ve got error 812

System Center DPM 2016 Install Error ID: 812

Report configuration failed. Verify that SQL Server Reporting Services is installed properly and that it is running. ID: 812 . When installing Data Protection Manager DPM  common installation error system admins encounter is ID: 812. This is caused by the SQL Server Reporting Services misreading the reporting database.

 

Cause:

Changed account which runs service: Reporting Service

 

Resolution:

Start -> Reporting Services Configuration Manager -> Encryption Keys -> Delete Encrypted Content (click: Delete) -> Change (click: Change) – generates new encryption keys :)

 

Now you may resume installation of DPM :)

  • DBCC DBCC CHECKDB (<db name>)
  • DBCC CHECKDB
  • DBCC CHECKDB (<db name>, REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST | REPAIR_REBUILD)
  • DBCC CHECKCONSTRAINTS
  • search constraints in DB by name:
    SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
    WHERE CONSTRAINT_NAME =’FK_Documents_Finance’