Category Archives: Andet

Change autodiscover URL (EWS URL / OAB URL / ECP URL / Activesync URL) – Exchange 2016 / Exchange 2019

If you want to change Mapi, Autodiscover / EWS / OAB / OWA / ECP / Activesync Url, this is how it works

Example you have bought a certificate on you external name, and now you got certificate warnings in outlook.

set-MapiVirtualDirectory -id "SERVERNAME\mapi (Default Web Site)" -internalurl https://owa.domain.prefix/mapi -externalurl https://owa.domain.prefix/mapi

Set-WebServicesVirtualDirectory -Identity "SERVERNAME\EWS (Default Web Site)" -InternalUrl https://owa.domain.prefix/EWS/Exchange.asmx -externalurl https://owa.domain.prefix /EWS/Exchange.asmx -BasicAuthentication:$true

Set-AutoDiscoverVirtualDirectory -Identity "SERVERNAME\Autodiscover (Default Web Site)" -internalurl https://owa.domain.prefix/autodiscover/autodiscover.xml -externalurl https://owa.domain.prefix/autodiscover/autodiscover.xml 

set-OabVirtualDirectory -identity "SERVERNAME\OAB (Default Web Site)" -internalurl https://owa.domain.prefix/OAB -externalurl https://owa.domain.prefix/OAB 

set-EcpVirtualDirectory -identity "SERVERNAME\ecp (Default Web Site)" -internalurl https://owa.domain.prefix/ecp -externalurl https://owa.domain.prefix/ecp

set-OwaVirtualDirectory -identity "SERVERNAME\owa (Default Web Site)" -internalurl https://owa.domain.prefix/owa -externalurl https://owa.domain.prefix/owa 

set-ActiveSyncVirtualDirectory  -identity "SERVERNAME\Microsoft-Server-ActiveSync (Default Web Site)" -internalurl https://owa.domain.prefix/Microsoft-Server-ActiveSync -externalurl https://owa.domain.prefix/Microsoft-Server-ActiveSync

Set-ClientAccessServer -Identity "SERVERNAME" –AutoDiscoverServiceInternalUri https://owa.domain.prefix/autodiscover/autodiscover.xml  

iisreset

 Or if this is a single server installation you can do it like this: (Or if you want all servers to use the same URL

get-mapivirtualdirectory | set-MapiVirtualDirectory -internalurl https://owa.domain.prefix/mapi -externalurl https://owa.domain.prefix/mapi

get-WebServicesVirtualDirectory | Set-WebServicesVirtualDirectory -InternalUrl https://owa.domain.prefix/EWS/Exchange.asmx -externalurl https://owa.domain.prefix/EWS/Exchange.asmx -BasicAuthentication:$true 

get-AutoDiscoverVirtualDirectory | Set-AutoDiscoverVirtualDirectory -internalurl https://owa.domain.prefix/autodiscover/autodiscover.xml -externalurl https://owa.domain.prefix/autodiscover/autodiscover.xml 

get-OabVirtualDirectory | set-OabVirtualDirectory -internalurl https://owa.domain.prefix/OAB -externalurl https://owa.domain.prefix/OAB

get-EcpVirtualDirectory | set-EcpVirtualDirectory -internalurl https://owa.domain.prefix/ecp -externalurl https://owa.domain.prefix/ecp 

get-OwaVirtualDirectory | set-OwaVirtualDirectory -internalurl https://owa.domain.prefix/owa -externalurl https://owa.domain.prefix/owa

get-ActiveSyncVirtualDirectory | set-ActiveSyncVirtualDirectory  -internalurl https://owa.domain.prefix/Microsoft-Server-ActiveSync -externalurl https://owa.domain.prefix/Microsoft-Server-ActiveSync

get-ClientAccessServer | Set-ClientAccessServer  –AutoDiscoverServiceInternalUri https://owa.domain.prefix/autodiscover/autodiscover.xml

iisreset

mssql get the backup information with copy_only information.

I need to find a way to see if the backup chain where broken. On my search I found this could script, created by “hot2use”
I have found this script on a forum.
https://dba.stackexchange.com/questions/204883/how-to-tell-if-a-backup-log-chain-is-broken

The script is very cool, as it will tell you the backup information, from a database. All you need to do is change this ‘<DATABASENAME>’ to yours database name, example ‘MASTER’.
It will also include if a job where COPY ONLY, and where the backup is save.

You can see in the screenshot below, that someone have run a full backup and save it on the D:\ drive, but it where a copy only so the backup is not broken.

/* ==================================================================
 Author......:  hot2use 
 Date........:  25.04.2018
 Version.....:  0.1
 Server......:  localhost (first created for)
 Database....:  msdb
 Owner.......:  -
 Table.......:  various
 Type........:  Script
 Name........:  ADMIN_Retrieve_Backup_History_Information.sql
 Description.:  Retrieve backup history information from msdb database
 ............   
 ............   
 ............       
 History.....:   0.1    h2u First created
 ............       
 ............       
================================================================== */
SELECT /* Columns for retrieving information */
       -- CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS SRVNAME, 
       msdb.dbo.backupset.database_name,
       msdb.dbo.backupset.backup_start_date,
       msdb.dbo.backupset.backup_finish_date,
       -- msdb.dbo.backupset.expiration_date, 

       CASE msdb.dbo.backupset.type
            WHEN 'D' THEN 'Full'
            WHEN 'I' THEN 'Diff'
            WHEN 'L' THEN 'Log'
       END  AS backup_type,
       -- msdb.dbo.backupset.backup_size / 1024 / 1024 as [backup_size MB],  
       msdb.dbo.backupmediafamily.logical_device_name,
       msdb.dbo.backupmediafamily.physical_device_name,
       -- msdb.dbo.backupset.name AS backupset_name,
       -- msdb.dbo.backupset.description,
       msdb.dbo.backupset.is_copy_only,
       msdb.dbo.backupset.is_snapshot,
       msdb.dbo.backupset.checkpoint_lsn,
       msdb.dbo.backupset.database_backup_lsn,
       msdb.dbo.backupset.differential_base_lsn,
       msdb.dbo.backupset.first_lsn,
       msdb.dbo.backupset.fork_point_lsn,
       msdb.dbo.backupset.last_lsn
FROM   msdb.dbo.backupmediafamily
       INNER JOIN msdb.dbo.backupset
            ON  msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id 

        /* ----------------------------------------------------------------------------
        Generic WHERE statement to simplify selection of more WHEREs    
        -------------------------------------------------------------------------------*/
WHERE  1 = 1

       /* ----------------------------------------------------------------------------
       WHERE statement to find Device Backups with '{' and date n days back
       ------------------------------------------------------------------------------- */
       -- AND     physical_device_name LIKE '{%'

       /* -------------------------------------------------------------------------------
       WHERE statement to find Backups saved in standard directories, msdb.dbo.backupfile AS b 
       ---------------------------------------------------------------------------------- */
       -- AND     physical_device_name  LIKE '[fF]:%'                          -- STANDARD F: Backup Directory
       -- AND     physical_device_name  NOT LIKE '[nN]:%'                      -- STANDARD N: Backup Directory

       -- AND     physical_device_name  NOT LIKE '{%'                          -- Outstanding Analysis
       -- AND     physical_device_name  NOT LIKE '%$\Sharepoint$\%' ESCAPE '$' -- Sharepoint Backs up to Share
       -- AND     backupset_name NOT LIKE '%Galaxy%'                           -- CommVault Sympana Backup


       /* -------------------------------------------------------------------------------
       WHERE Statement to find backup information for a certain period of time, msdb.dbo.backupset AS b 
       ---------------------------------------------------------------------------------- 
       AND    (CONVERT(datetime, msdb.dbo.backupset.backup_start_date, 102) >= GETDATE() - 7)  -- 7 days old or younger
       AND    (CONVERT(datetime, msdb.dbo.backupset.backup_start_date, 102) <= GETDATE())  -- n days old or older

       */

       /* -------------------------------------------------------------------------------
       WHERE Statement to find backup information for (a) given database(s) 
       ---------------------------------------------------------------------------------- */
       AND database_name IN ('<DATABASENAME>') -- database names
       -- AND     database_name IN ('rtc')  -- database names

        /* -------------------------------------------------------------------------------
        ORDER Clause for other statements
        ---------------------------------------------------------------------------------- */
        --ORDER BY        msdb.dbo.backupset.database_name, msdb.dbo.backupset.backup_finish_date -- order clause

        ---WHERE msdb..backupset.type = 'I' OR  msdb..backupset.type = 'D'
ORDER BY
       --2,

       2       DESC,
       3       DESC 

See if a database is using Enterprise features of an Microsoft SQL server.

Run this command to see if any database on the SQL Server is using enterprise features

IF OBJECT_ID('tempdb.dbo.##enterprise_features') IS NOT NULL
  DROP TABLE ##enterprise_features

CREATE TABLE ##enterprise_features
  (
     dbname       SYSNAME,
     feature_name VARCHAR(100),
     feature_id   INT
  )

EXEC sp_msforeachdb
N' USE [?] 
IF (SELECT COUNT(*) FROM sys.dm_db_persisted_sku_features) >0 
BEGIN 
   INSERT INTO ##enterprise_features 
    SELECT dbname=DB_NAME(),feature_name,feature_id 
    FROM sys.dm_db_persisted_sku_features 
END '
SELECT *
FROM   ##enterprise_features

 

CA ArcServe16.5 under Debian X64bit

  1. First install 32bit libs.
    apt-get install g++-multilib
  2. Then get the DEB’s files, from the cdrom
    mount /dev/cdrom /mnt
    cd /mnt/datamoverandagent/linux
    dpkg -i *.deb

    If you get errors like this: /opt/CA/ABcmagt/aglang_setup: 60: [: -e: unexpected operator.
    See here: http://kennethdalbjerg.dk/2014/04/07/error-while-installing-the-client-agent-on-ubuntu-and-debian-linux-unexpected-operator

  3. Run these commands
    /opt/CA/ABcmagt/caagentsetup
    /opt/CA/ABcmagt/caagent_autostrtstop
  4. Run this command to start R16.5 CA Agent.
    /etc/init.d/bab_agent start

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Compiling Linux Kernel 3.6.X the debian/ubuntu way for Hyper-V

Here is a guide to compile a kernel 3.6.X kernel for hyper-v the debian way.

sudo apt-get install git-core kernel-package fakeroot build-essential ncurses-dev

#Download the latest kernel
cd /usr/src
sudo wget --continue http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.6.6.tar.bz2
sudo tar jxvf linux-3.6.6.tar.bz2
cd linux-3.6.6

#Copy kernel config to the new source
sudo cp /boot/config-`uname -r` ./.config

#Choice what you want
#Hyper-V is locate at: Device Drivers, Microsoft Hyper-V guest support
sudo make menuconfig

#Compile the kernel
sudo make-kpkg clean
sudo fakeroot make-kpkg --initrd --append-to-version=-hyperv01 kernel_image kernel_headers
cd ..
sudo dpkg -i linux-image-3.6.*
sudo init 6

Allow Citrix Receiver to user nonsecurre http access instead of secure https access

To allow Citrix Receiver to used non secure http access, you need to first ofcouse install Citrix Receiver client.

  1. Then start Regedit:
    1. On 32 bit:
      1. Goto HKLM\SOFTWARE\Citrix\AuthManager
    2. On 64 bit:
      1. Goto HKLM\SOFTWARE\Wow6432Node\Citrix\AuthManager
  2. Under AuthManager create a new String Value (Reg_SZ) with name ConnectionSecurityMode and type Any under Data.

    1. On 32 bit:
      1. Goto HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\Dazzle
    2. On 64 bit:
      1. Goto HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\Dazzle
  1. Under Dazzle modify AllowAddStore to A