MSSQL Databases
To show all MSSQL databases except the normal system databases.
1 |
select * from sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb'); |
Kenneth Qvistgaard Dalbjerg, IT Konsulent i århus
To show all MSSQL databases except the normal system databases.
1 |
select * from sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb'); |
If you have enabled that a user get lock out in Active Directory, if the user type the password wrong X times. Then you might have experienced, that yours admin account get locked out...
When you try to delete a mailbox, you may get this error:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes. To get a list of all mailboxes in this database, run the command Get-Mailbox -Database Database ID. To get a list of all mailbox plans in this database, run the command Get-MailboxPlan. To get a list of archive mailboxes in this database, run the command Get-Mailbox -Database Database ID -Archive. To get a list of all public folder mailboxes in this database, run the command Get-Mailbox -Database Database ID -PublicFolder. To get a list of all arbitration mailboxes in this database, run the command Get-Mailbox -Database Database ID -Arbitration. To disable a non-arbitration mailbox so that you can delete the mailbox database, run the command Disable-Mailbox Mailbox ID. To disable an archive mailbox so you can delete the mailbox database, run the command Disable-Mailbox Mailbox ID -Archive. To disable a public folder mailbox so that you can delete the mailbox database, run the command Disable-Mailbox Mailbox ID -PublicFolder. Arbitration mailboxes should be moved to another server; to do this, run the command New-MoveRequest Parameters. If this is the last server in the organization, run the command Disable-Mailbox Mailbox ID -Arbitration -DisableLastArbitrationMailboxAllowed to disable the arbitration mailbox. Mailbox plans should be moved to another server; to do this, run the command Set-MailboxPlan MailboxPlan ID -Database Database ID. + CategoryInfo : InvalidOperation: (Database ID:DatabaseIdParameter) [Remove-MailboxDatabase], AssociatedUserMailboxExistException + FullyQualifiedErrorId : [Server=Server,RequestId=RequestId,TimeStamp=TimeStamp] [FailureCategory=Cmdlet-AssociatedUserMailboxExistException] XXXXXXXX,Microsoft.Exchange.Management.SystemConfigurationTasks.RemoveMailboxDatabase + PSComputerName : Computer Name |
This is because the mailbox database still contains data, that need to be moved, before you can deleted it. If you...
I have a customer, where we have taken over the support from an old supplier, so we don’t know much about their background. The first thing we do, was to update the Exchange Server....
To get a list of the databases files, and the current disk size in MB, and the Free Space in MB in each fil, you can use this commands
1 2 3 4 5 6 7 |
USE [DATABASE_NAME] SELECT DB_NAME() AS DbName, name AS FileName, size/128.0 AS CurrentSizeMB, size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS INT)/128.0 AS FreeSpaceMB FROM sys.database_files; |
If you need a...
This is how to get an CSV file, including user_SamAccountName;User_FullName;group1;group2;group3, etc It posible to remove the comment before break, and then break the export after 5 user, to see that it function well. It...
I need to search for entry in logfiles between 3/8-2017 and 6/8-2017. So i make this powershell script to prevent search all IIS logfiles. This script will copy all log files from the orginal...
If you need to give auser access to users calendar, based on if there are member of an group, this is the way. Start Exchange Management Shell
1 2 3 4 5 6 7 8 9 10 11 |
$users = Get-ADGroupMember [groupname] | select -ExpandProperty name foreach ($user in $users) { $Mailbox = Get-Mailbox $user #The Calendar, is name "Kalender" in danish add-MailboxFolderPermission -identity “$($Mailbox.Name):\kalender” -AccessRights Editor -User [username] set-MailboxFolderPermission -identity “$($Mailbox.Name):\kalender” -AccessRights Editor -User [username] #English calendar add-MailboxFolderPermission -identity “$($Mailbox.Name):\calendar” -AccessRights Editor -User [username] set-MailboxFolderPermission -identity “$($Mailbox.Name):\calendar” -AccessRights Editor -User [username] } |
To use this examples, there requirements are: VMware PowerCLI and a VMWare vCenter. This example will copy all vlan’s (Virtualportgroup) from one host to another. It will take all vlan’s from vSwitch0 on the...
If you want to issue a certificate with 20 years expiration, run this commands:
1 2 3 4 5 6 7 |
certutil -setreg ca\ValidityPeriodUnits 20 certutil -setreg ca\ValidityPeriod "Years" net stop certsvc net start certsvc |
To issues a certificate with a template, run this command
1 |
certreq -submit -attrib "CertificateTemplate:CertificateTemplateName" CSRfile.csr |
Sidste kommentar