Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AD-Control-Golang
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陶腾飞
AD-Control-Golang
Commits
3f3b8850
Commit
3f3b8850
authored
Apr 04, 2022
by
浔阳陌客
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022-04-04 3
parent
d29b7f6f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
public/dept.go
+6
-0
public/user.go
+3
-0
public/win.go
+10
-0
No files found.
public/dept.go
0 → 100644
View file @
3f3b8850
package
public
const
Region_nb
=
"宁波"
const
Region_zz
=
"郑州"
const
Dept_jishu
=
"技术部门"
const
Dept_chanpin
=
"产品部门"
public/user.go
View file @
3f3b8850
...
...
@@ -80,6 +80,9 @@ func GetHostnamePart(hostname string) ([]string, error) {
}
return
n
,
nil
}
func
GetIPFromInterface
()
{
}
// 判断计算机是否在zhiweireach中
func
Zhiweireach
()
bool
{
...
...
public/win.go
View file @
3f3b8850
...
...
@@ -490,6 +490,16 @@ func GetIPFromNslookup() string {
result
,
_
:=
PSCommandOutputNoSplit
(
cmd
)
return
strings
.
TrimSpace
(
result
)
}
func
GetMultiIPFromNslookup
()
[]
string
{
// 根据登录的服务器作为DNS的解析变量
// 在域中,为主控
// 在工作组中,为本机
// 因此可以可以机器简单的方式获取到本机IP
cmd
:=
fmt
.
Sprintf
(
"(Resolve-DnsName $env:computername -server %s -Type A).IPAddress"
,
User_logonserver
)
result
,
_
:=
PSCommandOutputNoSplit
(
cmd
)
result
=
strings
.
TrimSpace
(
result
)
return
strings
.
Split
(
result
,
"
\n
"
)
}
func
GetMacaddressFromIP
(
ip
string
)
string
{
cmd
:=
fmt
.
Sprintf
(
"(Get-NetAdapter -InterfaceIndex (Get-NetIPAddress -IPAddress %s).InterfaceIndex ).MacAddress"
,
ip
)
result
,
_
:=
PSCommandOutputNoSplit
(
cmd
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment