This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT dq.*,dqu.[User] FROM [Server].[DestQueue] dq LEFT JOIN [Server].[DestQueueUser] dqu ON dqu.QueueID = dq.ID | |
WHERE dqu.[user] IS NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-VMSwitch -SwitchName “NATSwitch” -SwitchType Internal | |
New-NetIPAddress -IPAddress 192.168.210.1 -PrefixLength 24 -InterfaceAlias “vEthernet (NATSwitch)” | |
New-NetNAT -Name “NATNetwork” -InternalIPInterfaceAddressPrefix 192.168.210.0/24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This script retrieves SQL Server version from BAK file and allows you to compare with your SQL Server version | |
#If your SQL Server version is lower that one which was used to create backup you won't be able to restore BAK file | |
$BakFile= Read-Host "Provide full path to SQL BAK file (including file name with extension)" | |
$VerDetectQuery="RESTORE HEADERONLY FROM DISK='$BakFile'" | |
$BakMajorVer=Invoke-Sqlcmd -Query $VerDetectQuery | Select-Object -ExpandProperty SoftwareVersionMajor | |
$BakMinorVer=Invoke-Sqlcmd -Query $VerDetectQuery | Select-Object -ExpandProperty SoftwareVersionMinor | |
$BakBuildVer=Invoke-Sqlcmd -Query $VerDetectQuery | Select-Object -ExpandProperty SoftwareVersionBuild | |
$BakVer= "$BakMajorVer.$BakMinorVer.$BakBuildVer.0" | |
$ServerSQLVer=Invoke-Sqlcmd -Query "SELECT SERVERPROPERTY('productversion')" | Select-Object -ExpandProperty Column1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Specify process name | |
$ProcName = "K2HostServer" | |
$procid=get-process $ProcName |select -expand id | |
# Create target folder if not exist: | |
$DumpPath="C:\dumps" | |
If (!(Test-Path $DumpPath)) | |
{ | |
Write-Host 'Creating folder' | |
(New-Item $DumpPath -ItemType Directory | out-null) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-ADObject "CN=NTDS Settings,CN=DOMAINCONTROLLER-NAME,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=DOMAIN,DC=COM" -Replace @{options='1'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Open PS session to one of your domain controllers if necessary: | |
Enter-PSSession -ComputerName cndrm-dc01 -Credential DOMAIN\administrator | |
#Select IsGlobalCatalog propery for your DCs: | |
Get-ADDomainController -Filter * | Select-Object -Property Name,IsGlobalCatalog | Format-Table -AutoSize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT segment_name, segment_type, bytes/1024/1024 MB | |
FROM user_segments | |
WHERE segment_type='TABLE' AND segment_name='YOUR_TABLE_NAME' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select owner, object_name, object_type | |
from ALL_OBJECTS | |
where object_name = 'YOUR_OBJECT_NAME' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @count int | |
SET @count = 1 | |
WHILE @count <= 200 | |
BEGIN | |
INSERT INTO [K2].[dbo].[StringSmO] values ('Subservice To Be Selected in Drop Down Long Name!') | |
SET @count = @count + 1 | |
END |