Skip to content

zhengjier/Powershell-Module-Aliyun

Repository files navigation

PowershellModule-AliyunDNS

English 中文

Table of Content

Introduction

This Powershell module allows you to do some basic DNS operations on Aliyun DNS.
Including query, create, edit and remove any dns records on Aliyun DNS.

Compatibility

PS Version Compatibility
5.1 ✔️
5.0 ✔️
4.0 ✔️
3.0 ✔️
2.0

Installation

To use this module

  1. Copy the "AliyunDNS" folder to your PS module path.
    Normally is %USERPROFILE%\Documents\WindowsPowershell\Modules\
  2. Edit the config.json file under the 'AliyunDNS' folder. Add the AccessKeyId and AccessKeySecret value to the file.
    Note: You should get these two values from Aliyun Admin Panel or ask your DNS administrator.
  3. Launch a Powershell window run as administrator.
  4. Execute the following powershell command to allow unsigned powershell scripts:
Set-ExecutionPolicy Unrestricted

Usage

Execute the folloing powershell command to start using the module and then have fun!:smile:

Import-Module AliyunDNS

DNS Records Management

Get DNS Records

Get-AliyunDNSRecord
    [Mandatory]-Doamin <DomainName>
    [Mandatory]-RecordId <RecordId>
    [Mandatory]-SubDomain <SubDomainName>
    -PageNumber <PageNo>
    -PageSize <PageSize>
    -Type <RecordType>

Note: You can only pass one of the mandatory parameters above.

Create New DNS Record

New-AliyunDNSRecord
    [Mandatory]-DomainName <DomainName>
    [Mandatory]-RR <Host>
    [Mandatory]-Type <RecordType>
    [Mandatory]-Value <RecordValue>
    -TTL <TTL>
    -Priority <Priority>
    -Line <Line>

Update DNS Record Information

Update-AliyunDNSRecord
    [Mandatory]-RecordId <RecordId>
    [Mandatory]-RR <Host>
    [Mandatory]-Type <RecordType>
    [Mandatory]-Value <RecordValue>
    -TTL <TTL>
    -Priority <Priority>
    -Line <Line>

Set DNS Status

Set-AliyunDNSRecordStatus
    [Mandatory]-RecordId <RecordId>
    [Mandatory]-Status <Status>

Remove DNS Record

Remove-AliyunDNSRecord
    [Mandatory]-RecordId <RecordId>

Domain Management

Get Domain Information

Get-AliyunDomain
    -DomainName <DomainName>
    -WhoIs <$True|$False>
Get-AliyunDomain
    -PageNumber <PageNumber>
    -PageSize <PageSize>

Get Domain Logs

Get-AliyunDomainLogs
    -PageNumber <PageNumber>
    -PageSize <PageSize>
    -KeyWord <Keyword>

Get Main Domain

Get-MainDomain
    -InputString <HostName>

More Information

For more information, please use help <Command>

阿里云DNS Powershell模块

目录

简介

阿里云DNS powershell模块用于进行基本的云解析操作,例如查询,新建,编辑,删除记录等

兼容性

Powershell版本 兼容性
5.1 ✔️
5.0 ✔️
4.0 ✔️
3.0 ✔️
2.0

安装

按照下面的步骤进行安装

  1. 拷贝AliyunDNS文件夹至powershell模块的默认路径。
    通常为%USERPROFILE%\Documents\WindowsPowershell\Modules\
  2. 编辑AliyunDNS文件夹中的config.json文件。
    添加AccessKeyIdAccessKeySecret的值。
    注意: 你可以从阿里云的管理员中心获得这两个值,或者向你的DNS管理员寻求帮助。
  3. 以管理员身份打开Powershell窗口。
  4. 执行以下命令以允许运行未签名的脚本:
Set-ExecutionPolicy Unrestricted

使用方法

执行以下指令以导入此模块,然后就可以愉快的使用了!:smile:

Import-Module AliyunDNS

域名解析管理

获取DNS记录

Get-AliyunDNSRecord
    [Mandatory]-Doamin <DomainName>
    [Mandatory]-RecordId <RecordId>
    [Mandatory]-SubDomain <SubDomainName>
    -PageNumber <PageNo>
    -PageSize <PageSize>
    -Type <RecordType>

注意: 在这个命令中你只允许传入一个强制参数。

新建DNS域名记录

New-AliyunDNSRecord
    [Mandatory]-DomainName <DomainName>
    [Mandatory]-RR <Host>
    [Mandatory]-Type <RecordType>
    [Mandatory]-Value <RecordValue>
    -TTL <TTL>
    -Priority <Priority>
    -Line <Line>

更新NDS记录内容信息

Update-AliyunDNSRecord
    [Mandatory]-RecordId <RecordId>
    [Mandatory]-RR <Host>
    [Mandatory]-Type <RecordType>
    [Mandatory]-Value <RecordValue>
    -TTL <TTL>
    -Priority <Priority>
    -Line <Line>

设置DNS记录状态

Set-AliyunDNSRecordStatus
    [Mandatory]-RecordId <RecordId>
    [Mandatory]-Status <Status>

删除DNS记录

Remove-AliyunDNSRecord
    [Mandatory]-RecordId <RecordId>

域名管理

获取域名信息

Get-AliyunDomain
    -DomainName <DomainName>
    -WhoIs <$True|$False>
Get-AliyunDomain
    -PageNumber <PageNumber>
    -PageSize <PageSize>

获取域名日志

Get-AliyunDomainLogs
    -PageNumber <PageNumber>
    -PageSize <PageSize>
    -KeyWord <Keyword>

获取主域名

Get-MainDomain
    -InputString <HostName>

更多帮助

更多帮助信息请使用help <Command>查询

About

This is a Powershell module to manager Aliyun Services

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published